Silver's Simple Site - Weblog - Tags - XPCOM


null exceptions

Ever had the feeling the program is simply mocking you? Try doing addEventListener("foo", null, false) in a recent Mozilla or Firefox and you might understand.

It doesn't just throw an error (which seems a fairly sensible thing to do, given I'm providing bogus data), it throws a null error. That's not an error which says only "null", the actual error object itself is null! What gives?

With my basic knowledge of how XPConnect & co. work I can't work out how this can happen normally. The following three cases are what normally happens:

  • If it can't convert the input data to make the wrapped call, you get a huge long error about "arg 1" or whatever.
  • If the native code returns a failure code, you get an exception generated by XPConnect (which is just as excessive as the argument error one).
  • If the native code returns a success code, you get the _retval, and not an exception.

This leaves only one option I can think of: the native code is returning a failure code, but also setting the XPConnect exception object explicitly to null (which allows native code to return nice exceptions to JS and other scripted languages, while still returning the 'nice' NS_ERROR code to native callers). I just can't find out where.

Permalink | Author: | Tags: Mozilla, XPCOM | Posted: 10:38PM on Sunday, 12 June, 2005 | Comments: 0


Mysterious Build Errors

Ever since bsmedberg landed bug 313309 part 2, I've been getting the following build error:

 nsIInterfaceRequestorUtils.cpp
Building deps for ....../../source-HEAD/mozilla/xpcom/glue/nsIInterfaceRequestorUtils.cpp
nsIInterfaceRequestorUtils.cpp
m:\tree-firefox-main\objdir\dist\include\xpcom\nsIProgrammingLanguage.h(35) : warning C4003: not enough actual parameters for macro 'NS_DEFINE_STATIC_IID_ACCESSOR'
m:\tree-firefox-main\objdir\dist\include\xpcom\nsIClassInfo.h(36) : warning C4003: not enough actual parameters for macro 'NS_DEFINE_STATIC_IID_ACCESSOR'
../../dist\include\xpcom\nsIInterfaceRequestor.h(41) : warning C4003: not enough actual parameters for macro 'NS_DEFINE_STATIC_IID_ACCESSOR'
m:\tree-firefox-main\objdir\dist\include\xpcom\nsISupportsUtils.h(202) : error C2039: 'GetIID' : is not a member of 'nsIInterfaceRequestor'
       ../../dist\include\xpcom\nsIInterfaceRequestor.h(38) : see declaration of 'nsIInterfaceRequestor'

This is the same error that the 'creature' tinderbox was getting, but unlike that machine, it didn't go away after all the bustage-fixes.

After nuking objdir/dist and objdir/xpcom/base - neither of which helped - I just nuked objdir/xpcom and it finally looks like it might work, having got twice as far into the build as the error point (though it would not surprise me if I needed to nuke other totally random directories later).

The build system is just broken.

It's getting to the point where I'm tempted to make an auto-build-fixer, that just keeps nuking random objdir folders until it works. It would be a more productive use of my time than fixing all these damn problems by hand.

Permalink | Author: | Tags: Mozilla, XPCOM | Posted: 02:26AM on Saturday, 12 November, 2005 | Comments: 0

Powered by the Content Parser System, copyright 2002 - 2024 James G. Ross.