Subj : Re: JS_ASSERT in js_MarkScriptFilename() To : Edward Chan From : Brendan Eich Date : Thu Feb 19 2004 12:33 pm Edward Chan wrote: >Hi Brendan, > >Thanks for the speedy reply. Unfortunately, I don't have the assert in the >debugger anymore, so I can't check if script->object exists. I'll check for >this if I hit this again. > >But basically, this is what I'm doing: > >1. call JS_CompileFileHandle() and get a JSScript*. >2. call JS_ExecuteScript() >3. call JS_DestroyScript() > >So basically, compile, execute, destroy. After executing the script, we >destroy it cuz we never use it again. Is there anything wrong with this >sequence? I'm not calling JS_NewScriptObject. And oddly, we've never run >into this using rc5. > > Maybe you ran into something like it (script_filename_table is new in RC6) and didn't crash. It's intermittent, clearly; it depends on memory pressure and other conditions that might govern whether a GC runs from within JS_ExecuteScript, or races with it on another thread. Are you using JS_BeginRequest and JS_EndRequest around the above three steps? A script being executed will be protected by its stack frame from being GC'd, so will be marked (so its filename will be marked too). That suggests that the GC is happening on another thread, and you are not bracketing 1-3 above with a request; or possibly the GC is nesting between steps 1 and 2 or 2 and 3. Can you show more code? /be .