assertion failed when calling JS_TriggerOperationCallback() from a thread

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

assertion failed when calling JS_TriggerOperationCallback() from a thread

franck.fr-3
Hello,

I have setup spidermonkey (tip 81bced59e8b3 2014.01.15) for XP_WIN with JS_THREADSAFE disable.
I have a watchdog thread that call JS_TriggerOperationCallback(rt) every 10ms (for this test)
I have a main thread that execute the following JS: "(function() { for (var i = 0; i < 1000000; ++i); })()"

When JS_TriggerOperationCallback is called while the JS code is running, the following assertion fails in in js::TriggerOperationCallbackForAsmJSCode():

  JS_ASSERT(rt->currentThreadOwnsOperationCallbackLock());

rt->operationCallbackLockTaken is expected to be true but is false.


watchdog stacktrace:
> js::TriggerOperationCallbackForAsmJSCode(JSRuntime * rt=0x00204d58)
  JSRuntime::triggerOperationCallback(JSRuntime::OperationCallbackTrigger trigger=TriggerCallbackAnyThread)
  JS_TriggerOperationCallback(JSRuntime * rt=0x00204d58)
  WatchDog::watchDogThreadProc(void * threadArg=0x009af354)

main thread stacktrace may vary but always occurs below the call to Interpret()

Do I miss something about the usage of JS_TriggerOperationCallback() ?

Thanks,
Franck
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: assertion failed when calling JS_TriggerOperationCallback() from a thread

andhow
It looks like JS_THREADSAFE needs to be #defined for AutoLockForOperationCallback to take the lock and set the flag that is being asserted.
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: assertion failed when calling JS_TriggerOperationCallback() from a thread

franck.fr-3
However the following code (in class AutoLockForOperationCallback) suggest that the !JS_THREADSAFE case is handled:

    bool currentThreadOwnsOperationCallbackLock() {
#if defined(JS_THREADSAFE)
        return operationCallbackOwner == PR_GetCurrentThread();
#else
        return operationCallbackLockTaken;
#endif
    }
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine