Closed
Bug 497032
Opened 16 years ago
Closed 16 years ago
"ASSERTION: Oops! You're asking for a weak reference to an object that doesn't support that" on bankrate.com (geolocation on stack)
Categories
(Core :: DOM: Geolocation, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a1
Tracking | Status | |
---|---|---|
status1.9.2 | --- | beta1-fixed |
status1.9.1 | --- | wanted |
People
(Reporter: jruderman, Assigned: ehsan.akhgari)
References
()
Details
(Keywords: assertion)
Attachments
(4 files)
7.40 KB,
text/plain
|
Details | |
1.15 KB,
patch
|
Details | Diff | Splinter Review | |
2.02 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
3.20 KB,
patch
|
benjamin
:
approval1.9.2+
dveditz
:
approval1.9.1.4-
|
Details | Diff | Splinter Review |
Steps to reproduce:
1. Load http://www.bankrate.com/ in a debug Firefox build.
2. Quit Firefox.
Result:
###!!! ASSERTION: Oops! You're asking for a weak reference to an object that doesn't support that.: 'factoryPtr', file nsWeakReference.cpp, line 109
Jonas, how can I debug this?
You need to dump the JS stack. There's some function somewhere in XPConnect that will dump the current JS stack to the console I think.
Jst knows iirc.
Reporter | ||
Comment 2•16 years ago
|
||
(gdb) call DumpJSStack()
0 [native frame]
1 anonymous() ["file:///Users/jruderman/central/debug-obj/dist/MinefieldDebug.app/Contents/MacOS/components/NetworkGeolocationProvider.js":179]
os = [xpconnect wrapped nsIObserverService @ 0x1e6228b0 (native @ 0x71dcf0)]
prefBranch = [xpconnect wrapped nsIPrefBranch @ 0x1906e2e0 (native @ 0x71e4f0)]
this = [object Object]
NetworkGeolocationProvider.js:179 is the following line in the shutdown method of WifiGeoPositionProvider:
os.removeObserver(this, "private-browsing");
Reporter | ||
Comment 3•16 years ago
|
||
mrbkap says weak references aren't available during shutdown, so Geolocation should not call removeObserver (or call it earlier than shutdown).
Blocks: 491759
Comment 4•16 years ago
|
||
as so long as we don't leak, i have no objection to removing the removeObserver call.
Are others also doing the wrong thing?
http://mxr.mozilla.org/mozilla-central/search?string=os.removeObserver%28this%2C+%22&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central
Comment 5•16 years ago
|
||
The others usually do it on xpcom-shutdown or some other equivalent, not sure if geo can use that though...
Comment 6•16 years ago
|
||
i have no problem with simply not removing the observer as so long as it doesn't cause a leak (which it probably doesn't).
Comment 7•16 years ago
|
||
I think that causes the assertion in bug 481317, at least if I understood that correctly.
Note that since the QI to weaksupports currently fails, the call to removeObserver is a no-op.
Comment 9•16 years ago
|
||
Assignee: nobody → doug.turner
Attachment #397191 -
Flags: review?(highmind63)
Comment 10•16 years ago
|
||
Comment on attachment 397191 [details] [diff] [review]
patch v.2
I'm totally not a reviewer for this, but afaik you're responsible to remove any observers you add. All the other places use xpcom-shutdown (even those observing xpcom-shutdown itself) for this, is there any reason you can't?
Even though it probably isn't a memory leak per se (your really using this for the life of the app, which xpcom-shutdown signals), convention in current code dictates that it's good practice.
Attachment #397191 -
Flags: review?(highmind63)
Comment 11•16 years ago
|
||
I thought i would get your input Natch. As jonas mentioned, it is a noop and therefore probably not needed.
jonas, do you have an opinion one way or the other?
Comment 12•16 years ago
|
||
Hrm, on second thought, this is component js, rules are somewhat different here. See nsSessionStore, which afaict doesn't release _any_ of its observers (and it has a bunch).
Component code is supposed to live for the lifetime of the app so using xpcom-shutdown to remove the observers is kind of redundant, I guess.
Assignee | ||
Comment 13•16 years ago
|
||
If we make this object support weak references, and not call RemoveObserver, the observer will be released when the observer service dies, and nothing will crash if WifiGeoPositionProvider is shut down before that time.
Attachment #397524 -
Flags: review?(jonas)
Attachment #397524 -
Flags: review?(jonas) → review+
Comment 14•16 years ago
|
||
You have to also change the third argument of addObserver to true or this change won't take affect since you're still asking for a strong reference.
Assignee | ||
Comment 15•16 years ago
|
||
Landed with comment 14 addressed:
http://hg.mozilla.org/mozilla-central/rev/376f6bf359c8
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
Assignee | ||
Updated•16 years ago
|
Attachment #397524 -
Flags: approval1.9.2?
Attachment #397524 -
Flags: approval1.9.1.4?
Comment 16•15 years ago
|
||
Comment on attachment 397524 [details] [diff] [review]
Patch (v3)
For branches would prefer to approve a patch that reflects what got checked in.
Attachment #397524 -
Flags: approval1.9.1.4?
Assignee | ||
Updated•15 years ago
|
Attachment #397524 -
Flags: approval1.9.2?
Assignee | ||
Comment 17•15 years ago
|
||
Attachment #401715 -
Flags: approval1.9.2?
Attachment #401715 -
Flags: approval1.9.1.4?
Comment 18•15 years ago
|
||
Comment on attachment 401715 [details] [diff] [review]
As checked in
Approved for 1.9.1.4, a=dveditz for release-drivers
Attachment #401715 -
Flags: approval1.9.1.4? → approval1.9.1.4+
Updated•15 years ago
|
Assignee: doug.turner → ehsan.akhgari
Comment 19•15 years ago
|
||
Comment on attachment 401715 [details] [diff] [review]
As checked in
past code-freeze for 1.9.1.4, removing non-blocker approval.
Attachment #401715 -
Flags: approval1.9.1.4+ → approval1.9.1.4-
Assignee | ||
Updated•15 years ago
|
Attachment #401715 -
Flags: approval1.9.1.5?
Updated•15 years ago
|
Attachment #401715 -
Flags: approval1.9.2? → approval1.9.2+
Assignee | ||
Comment 20•15 years ago
|
||
status1.9.2:
--- → beta1-fixed
Comment 21•15 years ago
|
||
QA's insists on a testcase if we're going to take this on the increasingly conservative 1.9.1 branch
Keywords: testcase-wanted
Updated•15 years ago
|
Flags: in-testsuite?
Comment 22•15 years ago
|
||
Comment on attachment 401715 [details] [diff] [review]
As checked in
We need a testcase before we take this on 1.9.1.
Attachment #401715 -
Flags: approval1.9.1.6?
Assignee | ||
Comment 23•15 years ago
|
||
Is this really wanted for 1.9.1? I want to make sure it's needed before I invest time in creating a test case for it.
Alternatively, Natch, are you willing to write a test for this?
status1.9.1:
--- → ?
Comment 24•15 years ago
|
||
Yes, this is wanted on 1.9.1. (And really, it should've had a testcase before landing on trunk or 1.9.2, but it's a bit too late for that now.)
Assignee | ||
Comment 25•15 years ago
|
||
Doug, do you have any idea how to write a test case for this bug? Should I just write an xpcshell test which calls nsIGeolocationProvider::shutdown? Are assertions considered as failures in debug build tests?
Updated•9 years ago
|
Keywords: testcase-wanted
You need to log in
before you can comment on or make changes to this bug.
Description
•