Last Comment Bug 526709 - LS_QueryInterface throws the wrong exception (NS_ERROR_NOT_IMPLEMENTED) instead of (NS_ERROR_NO_INTERFACE)
: LS_QueryInterface throws the wrong exception (NS_ERROR_NOT_IMPLEMENTED) inste...
Status: RESOLVED FIXED
:
Product: Toolkit
Classification: Components
Component: Places (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla1.9.3a1
Assigned To: timeless
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-04 22:06 PST by John J. Barton
Modified: 2009-12-19 04:52 PST (History)
4 users (show)
bugzilla: blocking1.9.2-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
beta3-fixed
.8-fixed


Attachments
patch (636 bytes, patch)
2009-11-05 04:59 PST, timeless
mak77: review+
bugzilla: approval1.9.2+
dveditz: approval1.9.1.8+
Details | Diff | Splinter Review

Description John J. Barton 2009-11-04 22:06:21 PST
Every time I run firefox I get an uncaught exception error in 
file:///C:/mozilla/firefox-3.6b1pre.en-US.win32/firefox/modules/utils.js
line 128.
The problem is not on that line however. The bug is in nsLivemarkService.js.

I set statement
  debugger;
on line 842, the first line of LS_QueryInterface. Then run Firefox and Chromebug breaks on line 842. By single stepping I can see the service creation pass through LS_QueryInterface a number of times. Eventually it gets call with aIID
{986c11d0-f340-11d4-9075-0010a4e73d9a}
which is nsIClassInfo. On that call the QI issues 
    throw Cr.NS_ERROR_NOT_IMPLEMENTED; // 2147500033

Based on this I am pretty sure that the uncaught exception is caused by this throw. Most users do not see this because the XPCOM layer does not report exceptions for some (dubious) historical reason.

However to debug extensions we need to watch for all exceptions and this one is just noise, in addition to being a bug, but consequences I am uncertain.

So either livemark-service;2 needs to implment nsIClassInfo or the getService needs to not ask for it.

See also Bug 499568
Comment 1 timeless 2009-11-05 04:59:50 PST
Created attachment 410483 [details] [diff] [review]
patch
Comment 2 Marco Bonardo [::mak] 2009-11-05 06:02:18 PST
Comment on attachment 410483 [details] [diff] [review]
patch

while this is correct, i'll file a bug to convert it to use XPCOMUtils unless someone has anything against that.
Comment 3 John J. Barton 2009-11-05 07:43:54 PST
I just want to check: I guess this change will cause getService to trap the throw? That is, this will fix the problem I see, not just change the error number?
Comment 4 Marco Bonardo [::mak] 2009-11-05 07:55:33 PST
GetInterface and QueryInterface should never report a NS_ERROR_NO_INTERFACE but will report others.
Comment 5 John J. Barton 2009-11-05 08:12:53 PST
Requesting blocking so that this issue is evaluated, given that the call occurs on every startup of firefox and the fix is small.
Comment 6 Marco Bonardo [::mak] 2009-11-05 08:24:30 PST
filed bug 526777 about XPCOMUtils

this probably doesn't block, but once it's on trunk will be easy to get approval.
Comment 7 Dão Gottwald [:dao] 2009-11-05 23:42:26 PST
http://hg.mozilla.org/mozilla-central/rev/7dac283e2028
Comment 8 Marco Bonardo [::mak] 2009-11-06 07:40:40 PST
notice in bug 526777 i've moved this code to XPCOMUtils, in case that would cause problems please contact me.

that means this code has been replaced on trunk, but we should take this patch on branches.
Comment 9 Johnathan Nightingale [:johnath] 2009-11-10 14:40:59 PST
Sucks, will gladly approve the fix, but wouldn't hold the release of Firefox 3.6 if this were the last bug.
Comment 11 Marco Bonardo [::mak] 2009-11-11 02:42:25 PST
Comment on attachment 410483 [details] [diff] [review]
patch

i suppose would be cool and not too much of a problem getting this on 1.9.1.7
Comment 12 Daniel Veditz [:dveditz] 2009-12-18 11:52:27 PST
Comment on attachment 410483 [details] [diff] [review]
patch

Approved for 1.9.1.8, a=dveditz for release-drivers
Comment 13 Marco Bonardo [::mak] 2009-12-19 04:52:15 PST
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/459c9734217d

Note You need to log in before you can comment on or make changes to this bug.