Subj : Re: Crashing in JS_EvaluateScript(). Any insight? To : netscape.public.mozilla.jseng From : Brendan Eich Date : Wed Sep 08 2004 12:50 pm J.P. wrote: > I built the JS engine with JS_THREADSAFE using VC6. Now, when I call > JS_EvaluateScript(), it will ocasionally crash. > > The call stack shows that the program crashes at > OBJ_SET_REQUIRED_SLOT(cx, obj, slot, v), because > obj->map->ops->setRequiredSlot is not a valid pointer, with value > 0xcdcdcdcd. Actually other funtion pointers such as getAttributes(), > setAttributes(), deleteProperty()... have the same value too. > > I just don't know where to start to fix it. Any hint? There's not nearly enough information here to help. It sounds like a dangling object pointer, which usually means you held onto an unrooted pointer in a native data structure, and passed it into the engine after the GC had collected the referenced object. You need to show the stack backtrace, and where in the engine the crash happens, and what the flow of parameters from your code into that point in the engine might be. /be .