I am using SpiderMonkey mozjs-31.2.0 to work with Unity3D (Unity3D.com). 

SpiderMonkey is initialized when Unity3D editor enters Play mode, and is 
shutted down when the editor exits editor mode. 

Inifinite loop happens during SECOND initialization of SpiderMonkey when trying 
to JS_CompileScript FIRST JavaScript file which is marked (1) in the code 
below. 
The library was built with --disable-shared-js and --disable-threadsafe. 

Everything is fine on Windows!


Call stack: 
-----------------------------------------------
0 _pthread_cond_check_init 
1 _pthread_cond_wait 
2 pthread_cond_wait$UNIX2003 
3 PR_WaitCondVar(nspr::CondVar*, unsigned int) 
4 js::SourceCompressTask::complete() 
5 js::frontend::CompileScript(js::ExclusiveContext*, js::LifoAlloc*, 
JS::Handle<JSObject*>, JS::Handle..mpileOptions const&, 
JS::SourceBufferHolder&, JSString*, unsigned int, js::SourceCompressTask*) 
6 JS::Compile(JSContext*, JS::Handle<JSObject*>, JS::ReadOnlyCompileOptions 
const&, char16_t const*, unsigned long) 
7 JS::Compile(JSContext*, JS::Handle<JSObject*>, JS::ReadOnlyCompileOptions 
const&, char const*, unsigned long) 




Is it an known issue? or any ideas to fix this? 

(BTW, there was another crash of JS::CompileOptions and was fixed by defining 
JSGC_USE_EXACT_ROOTING in js-config.h.) 

----------------------------------------------------------------------------- 
MOZ_API _BOOL evaluate( const char* ascii, int length, const char* filename ) 
{ 
    WriteLog(filename); 
    JS::CompileOptions options(g_cx); 
    WriteLog("1"); 
    options.setVersion(JSVERSION_LATEST); 
    WriteLog("2"); 
    options.setUTF8(true); 
    WriteLog("3"); 
    options.setFileAndLine(filename, 1); 
    WriteLog("4"); 

    JS::RootedObject roGlobal(g_cx, g_global.ref().get()); 
    WriteLog("5"); 

    JS::RootedScript jsScript(g_cx, JS_CompileScript(g_cx, roGlobal, ascii, 
length, options));  ///////// (1) CRASHED here 

    WriteLog("6"); 
    if (jsScript == 0) 
    { 
        Assert(false, "JS_CompileScript fail"); 
        return _FALSE; 
    } 

    JS::RootedValue val(g_cx); 
    if (!JS_ExecuteScript(g_cx, roGlobal, jsScript, &val)) 
    { 
        Assert(false, "JS_ExecuteScript fail"); 
        return _FALSE; 
    } 

    WriteLog("7\n"); 
    return _TRUE; 
} 
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to