Subj : Re: JS_THREADSAFE / assertion failed on rt->gcRunning To : netscape.public.mozilla.jseng From : smaraux Date : Tue Mar 08 2005 05:49 am I had an unexpected call to a method calling JS from another Thread, an architecture mistake which is now fixed. Things are working flawlessly now. I didn't need JS_THREADSAFE tag. Thank you Brendan. Brendan Eich wrote in message news:<42288BDB.3000204@meer.net>... > sebastien maraux wrote: > > > > Here is my call stack when the assertion fails : > > I call a function which should update data of my script : > > > This stack is listed in the reverse of the normal order, but ok. > > > > JS_CallFunctionValue(m_JSContext, m_GlobalObject, fval, 2, argv, > > &rval); > > -> js_InternalInvoke(JSContext *cx, JSObject *obj, jsval fval, uintN > > flags, > > uintN argc, jsval *argv, jsval *rval) > > -> js_Invoke(JSContext *cx, uintN argc, uintN flags) //call a function > > to move an object left > > -> js_Interpret(cx, &v); > > -> JSBool js_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, > > jsval *vp) > > -> js_TryMethod(cx, obj, cx->runtime->atomState.toStringAtom, 0, NULL, > > &v)) > > -> js_InternalInvoke(JSContext *cx, JSObject *obj, jsval fval, uintN > > flags, > > uintN argc, jsval *argv, jsval *rval) > > -> js_Invoke() // call a function to draw moved object > > -> (my function) fieldToString() // try to print its new position : > > build a string from its vector position > > -> JS_NewUCStringCopyZ > > -> JS_NewString > > -> js_AllocGCThing > > -> assertion failed on JS_ASSERT(!rt->gcRunning); > > > What is on the stack "below" JS_CallFunctionValue? Please show the > entire stack. Also please show all threads' stacks (I know you said you > used only one thread, but something left rt->gcRunning set, which means > either another thread is in the GC, was in it and died without crashing > the entire process, or a GC is nesting on this stack -- or you have an > inconsistent build of some sort). > > /be .