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...
Product: Toolkit
Classification: Components
Component: Places (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla1.9.3a1
Assigned To: timeless
: Marco Bonardo [::mak]
Depends on:
  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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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 User image John J. Barton 2009-11-04 22:06:21 PST
Every time I run firefox I get an uncaught exception error in 
line 128.
The problem is not on that line however. The bug is in nsLivemarkService.js.

I set statement
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
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 User image timeless 2009-11-05 04:59:50 PST
Created attachment 410483 [details] [diff] [review]
Comment 2 User image Marco Bonardo [::mak] 2009-11-05 06:02:18 PST
Comment on attachment 410483 [details] [diff] [review]

while this is correct, i'll file a bug to convert it to use XPCOMUtils unless someone has anything against that.
Comment 3 User image 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 User image 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 User image 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 User image 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 User image Dão Gottwald [:dao] 2009-11-05 23:42:26 PST
Comment 8 User image 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 User image 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 User image Marco Bonardo [::mak] 2009-11-11 02:42:25 PST
Comment on attachment 410483 [details] [diff] [review]

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

Approved for, a=dveditz for release-drivers
Comment 13 User image Marco Bonardo [::mak] 2009-12-19 04:52:15 PST

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