Closed
Bug 447764
Opened 16 years ago
Closed 16 years ago
Investigate if event listeners aren't kept alive long enough
Categories
(Core :: DOM: Events, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: smaug, Assigned: smaug)
References
Details
(Keywords: fixed1.9.0.2, regression, Whiteboard: [sg:critical?] maybe gc issue)
Attachments
(2 files)
1.03 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
samuel.sidler+old
:
approval1.9.0.2+
|
Details | Diff | Splinter Review |
6.72 KB,
patch
|
Details | Diff | Splinter Review |
Bug 333078 changed event listener manager a bit and removed one nsRefPtr, which looks pretty important to me. http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=mozilla/content/events/src&command=DIFF_FRAMESET&file=nsEventListenerManager.cpp&rev2=1.253&rev1=1.252 If event is dispatched via DispatchToInterface, the listener is kept alive because of the addrefing QueryInterface. However to usual case is to use HandleEventSubType and there addrefing doesn't happen. Any idea why bug 333078 removed: nsRefPtr<nsIDOMEventListener> listener = ls->mListener.Get(); ?
Assignee | ||
Comment 1•16 years ago
|
||
The name of the variable should make it clear why it is there. (And note, with event listeners nsRefPtr is needed, not nsCOMPtr. That is, IIRC, because of the interface dispatch thingie, see DispatchToInterface) I'm hoping someone proves this a false alarm... And thanks to roc asking whether listeners are kept alive. I knew there was the nsRefPtr when ELM was cleaned-up.
Assignee: nobody → Olli.Pettay
Status: NEW → ASSIGNED
Attachment #331078 -
Flags: superreview?(bzbarsky)
Attachment #331078 -
Flags: review?(bzbarsky)
Comment 2•16 years ago
|
||
Comment on attachment 331078 [details] [diff] [review] keep listeners alive Looks ok, but can you write a mochitest for this? Just removing the listener while in dispatch and then triggering gc should lead to issues, right?
Attachment #331078 -
Flags: superreview?(bzbarsky)
Attachment #331078 -
Flags: superreview+
Attachment #331078 -
Flags: review?(bzbarsky)
Attachment #331078 -
Flags: review+
Assignee | ||
Comment 3•16 years ago
|
||
I think this needs that the listener is implemented in C++. JS engine should keep functions (== event listeners) alive.
Comment 4•16 years ago
|
||
Even if they're anonymous functions and even if you gc?
Assignee | ||
Comment 5•16 years ago
|
||
I'm not sure if the testcase should be pushed before the fix has landed to 1.9.0 branch too. But anyway, the testcase does show that we do have a problem and that the patch does fix it.
Assignee | ||
Updated•16 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: wanted1.9.0.x?
Flags: in-testsuite?
Flags: blocking1.9.0.2?
Resolution: --- → FIXED
Comment 6•16 years ago
|
||
Olli, if this patch is good for the 1.9 branch can you please request approval on it? We'll need to get it approved and landed in the next 30 hours if you want it (and I think you do because I do too! ;) ). fwiw, the test can land after we've fixed this in 1.9.
Flags: wanted1.9.0.x? → wanted1.9.0.x+
Assignee | ||
Updated•16 years ago
|
Attachment #331078 -
Flags: approval1.9.0.2?
Comment 7•16 years ago
|
||
Comment on attachment 331078 [details] [diff] [review] keep listeners alive Approved for 1.9.0.2. Please land in CVS. a=ss
Attachment #331078 -
Flags: approval1.9.0.2? → approval1.9.0.2+
Comment 8•16 years ago
|
||
Probably need an sg marker here too.
Flags: blocking1.9.0.2? → blocking1.9.0.2+
Assignee | ||
Updated•16 years ago
|
Keywords: fixed1.9.0.2
Updated•16 years ago
|
Whiteboard: [sg:critical?] maybe gc issue
Updated•16 years ago
|
Group: core-security
Assignee | ||
Comment 9•16 years ago
|
||
I checked in the test, but OSX/qm-moz2mini01 didn't like it for some reason. It did compile and run fine on some other tboxes (also OSX). I don't have a mac, so hard to find the reason for the problem.
Comment 10•16 years ago
|
||
Yeah, running it over here works fine too. Is the box in question even on the Firefox tinderbox? I don't see it there... (That is, could the issue be with the code the box is building, not with your code or the test itself?)
Assignee | ||
Comment 11•16 years ago
|
||
It is there, or at least was there. There was also something strange happening with qm-win2k3-moz2-01, first it managed to compile and run the test but next time it couldn't compile it anymore.
Updated•15 years ago
|
Assignee | ||
Updated•12 years ago
|
Flags: in-testsuite? → in-testsuite-
You need to log in
before you can comment on or make changes to this bug.
Description
•