Subj : Re: Dormant stack frames.... To : netscape.public.mozilla.jseng From : "Jeroen de Borst" Date : Thu May 01 2003 06:43 pm Nevermind, I just see the real problem.... The new StackFrames created by the interpreter are on the real stack. I perform stack switching, so when the GC iterates over the other contexts (which have their stack saved away) their cx->fp actually points to the current stack! thanks anyway, J. "Jeroen de Borst" wrote in message news:b8r51u$ks01@ripley.netscape.com... > Hi, > > I've run into a problem... > > I am executing several scripts simultaneuosly (using a different context for > every invocation). The scripts may invoke a native function which causes > execution of that script to suspend, to later be resumed. This > suspend/resume is done using stack-saving and longjmp. Since no JS code is > ever running in parallel I have not compiled with JS_THREADSAFE defailed. > Now when I destroy the context of a terminated script, while I have one of > these suspended scripts still around, I get an assertion failure from js_GC: > > Assertion failure: !chain->dormantNext, at jsgc.c:1193 > > Browsing through the sources I sort of understand that the whole dormant > thing is there to deal with what I am trying to do: executing the GC whilte > other stack frames are active? I see this code in js_Execute. I think the > problem is that I execute my scripts by invoking JS_CallFunction (which uses > js_InternalCall) rather than JS_ExecuteScript (which uses js_Execute). > > Is there anyway to make this work? Or should I try to map my functions to > scripts (I'd rather not, but would, if this is the only way)? Or shouldn't > JS_CallFunction (js_InternalCall) contain the same logic regarding dormant > stack frams as js_Execute? > > thanks, > Jeroen > > .