Re: FF 3.5 and JS_GC Crashes

"John J. Barton" <[email protected]> Mon, 27 Jul 2009 08:32:47 -0700
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Message-ID <[email protected]>
Glenn Boysko wrote:
> David:
> 
>> Sounds like your fine. The timer fires on the main thread event queue.
>> I just wanted to make sure you were specifically creating a thread to
>> do some work and invoking some JS code on that. That causes lots of
>> problems, since GC is to only occur on the main thread.
> 
> Thanks for the reply. What about the callbacks from
> jsdIDebuggerService methods (e.g., enumerateScripts)? Are they called
> back on the main thread? Same goes for the nsIWebProgressListener
> callbacks (e.g., onStateChange).

Yes, yes, yes.

> 
> Can you get GC problems if you don't call QueryInterface in JS code?
> I'm thinking specifically of the instances supplied in
> nsIWebProgressListener callbacks (e.g., going from nsIRequest to
> nsIHttpChannel).

No. You can generally assume that the entire engine is single threaded, 
anything that looks like another thread is based on yield. The 
exceptions are small enough you have to work to find them.

> 
> Any suggestions are appreciated. Can a debug version of FF help to
> identify the source of these crashes? 

I don't think you should plan on using debugger on GC crashes, you will 
waste a lot of time.  The crash will occur in GC but the bug is in your 
code: the debugger will lead you astray.

jjb