Closed
Bug 496582
Opened 16 years ago
Closed 3 years ago
nsCocoaWindow_NSWindow_sendEvent should not assume |self| will remain valid
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
WORKSFORME
| Tracking | Status | |
|---|---|---|
| status1.9.1 | --- | wontfix |
People
(Reporter: stuart.morgan+bugzilla, Unassigned)
Details
(Keywords: fixed1.9.0.12, regression)
Attachments
(1 file, 3 obsolete files)
|
1.21 KB,
patch
|
jaas
:
review+
roc
:
superreview+
dveditz
:
approval1.9.0.12+
|
Details | Diff | Splinter Review |
An early crash from Camino 2.0b3:
http://crash-stats.mozilla.com/report/index/c67985f4-f77e-4c83-bb33-b08d82090604
shows a crash under _freedHandler in
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/widget/src/cocoa/nsCocoaWindow.mm&rev=1.151&mark=2155#2155
Given that, it looks like it's not safe to assume that the window will still be valid after [self nsCocoaWindow_NSWindow_sendEvent:anEvent];
If nothing else there should be a [self retain]; just before calling through, and a [self release] at the end of the method (I'd rather it not be an autorelease, since there should be as little impact on object lifetimes as possible).
Since this is a regression caused by the swizzling, I'd really like to see it fixed in 1.9.0.x
Flags: wanted1.9.0.x?
Comment 1•16 years ago
|
||
> there should be a [self retain]; just before calling through, and a
> [self release] at the end of the method
In light of your stack, I think this is a reasonable suggestion. I'll
post a patch that does this.
This bug isn't "caused by method swizzling" -- it's caused by
the assumption that an NSWindow will always be valid after a call to
[NSWindow sendEvent:], which your stack shows to be false.
| Reporter | ||
Comment 2•16 years ago
|
||
(In reply to comment #1)
It helps if you don't misquote me. I did not say "caused by method swizzling", I said "caused by *the* swizzling", as in "caused by the swizzling I just mentioned two sentences ago, so I assume the reference is painfully clear".
Comment 3•16 years ago
|
||
Attachment #381830 -
Flags: review?(joshmoz)
Comment 4•16 years ago
|
||
Attachment #381831 -
Flags: review?(joshmoz)
Comment on attachment 381830 [details] [diff] [review]
Trunk patch
Maybe use nsAutoRetainCocoaObject?
Comment 6•16 years ago
|
||
> Maybe use nsAutoRetainCocoaObject?
Fine with me. New patch coming up shortly.
Comment 7•16 years ago
|
||
Attachment #381830 -
Attachment is obsolete: true
Attachment #381855 -
Flags: review?(joshmoz)
Attachment #381830 -
Flags: review?(joshmoz)
Attachment #381855 -
Flags: review?(joshmoz) → review+
Comment on attachment 381831 [details] [diff] [review]
1.9.0-branch patch
We should probably do autoretain on 1.9.0 too, adding all necessary code.
Attachment #381831 -
Flags: review?(joshmoz)
Updated•16 years ago
|
Attachment #381855 -
Flags: superreview?(roc)
Comment 9•16 years ago
|
||
Updated•16 years ago
|
Attachment #382323 -
Attachment description: 1.9.0-branch patch v1.1 (follow Josh → 1.9.0-branch patch v1.1 (follow Josh's suggestion)
Attachment #382323 -
Flags: review?(joshmoz)
Attachment #382323 -
Flags: review?(joshmoz) → review+
Updated•16 years ago
|
Attachment #382323 -
Flags: superreview?(roc)
Attachment #381855 -
Flags: superreview?(roc) → superreview+
Attachment #382323 -
Flags: superreview?(roc) → superreview+
Updated•16 years ago
|
Attachment #381831 -
Attachment is obsolete: true
Comment 10•16 years ago
|
||
Comment on attachment 381855 [details] [diff] [review]
Trunk patch v1.1 (follow Josh's suggestion)
Oops. This has been made obsolete by the patch for bug 178324, which
got rid of nsCocoaWindow_NSWindow_sendEvent.
Updated•16 years ago
|
Attachment #381855 -
Attachment is obsolete: true
Updated•16 years ago
|
Attachment #382323 -
Flags: approval1.9.0.12?
Comment 11•16 years ago
|
||
Is there anywhere else this patch should land, like 1.9.1?
Assignee: nobody → smichaud
Comment 12•16 years ago
|
||
It should probably also land on the 1.9.1 branch.
Updated•16 years ago
|
Flags: wanted1.9.1.x+
Flags: wanted1.9.0.x?
Flags: wanted1.9.0.x+
Comment 13•16 years ago
|
||
Comment on attachment 382323 [details] [diff] [review]
1.9.0-branch patch v1.1 (follow Josh's suggestion)
Approved for 1.9.0.12, a=dveditz for release-drivers
Attachment #382323 -
Flags: approval1.9.0.12? → approval1.9.0.12+
Comment 14•16 years ago
|
||
Comment on attachment 382323 [details] [diff] [review]
1.9.0-branch patch v1.1 (follow Josh's suggestion)
Landed on the 1.9.0 branch:
Checking in widget/src/cocoa/nsCocoaWindow.mm;
/cvsroot/mozilla/widget/src/cocoa/nsCocoaWindow.mm,v <-- nsCocoaWindow.mm
new revision: 1.152; previous revision: 1.151
done
Updated•16 years ago
|
Comment 15•16 years ago
|
||
This isn't really RESOLVED FIXED since it needs to land on 1.9.1 as well and Bugzilla doesn't really have a way to say "this bug is for two branches but not for trunk". So I tend to prefer such bugs staying open until they're fixed in both places.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 16•16 years ago
|
||
Fixed this in 1.9.0.12, so we should fix it in 1.9.1.x, maybe 1.9.1.1?
Flags: blocking1.9.1.1?
Comment 17•16 years ago
|
||
Not going to block 1.9.1.1 on this, but Steven if you can work up a 1.9.1 patch, we'll look at it for approval.
Flags: blocking1.9.1.1?
Updated•16 years ago
|
status1.9.1:
--- → wanted
Flags: wanted1.9.1.x+
Updated•3 years ago
|
Assignee: smichaud → nobody
Updated•3 years ago
|
Status: REOPENED → RESOLVED
Closed: 16 years ago → 3 years ago
Resolution: --- → FIXED
Updated•3 years ago
|
Resolution: FIXED → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•