Re: How to create multiple contexts in different threads?

[email protected]
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
On Wednesday, March 30, 2016 at 9:17:53 PM UTC+2, [email protected] wrote:
> On Wednesday, March 30, 2016 at 9:09:46 PM UTC+2, [email protected] wrote:
> > PR_GetCurrentThread () also returns 0.
> 
> That should not happen according to the documentation. I added an assertion in isLock to make sure it was not because gdb and it fails:
> Assertion failure: PR_GetCurrentThread()!=nullptr, at /home/clement/src/mozilla-esr38/js/src/vm/HelperThreads.cpp:537
> 
> Any idea about why this happens? Should I ask on a NSPR mailing list instead?

I think I solved most of my problems.

The PR_GetCurrentThread problem was solved by using --with-system-nspr configure option. I am still unsure where the broken NSPR that was used before came from.

I then got some race with signal handler installation. From AsmJSSignalHandlers.js:1011 (js::EnsureSignalHandlersInstalled)
    // All the rest of the handlers are process-wide and thus must only be
    // installed once. We assume that there are no races creating the first
    // JSRuntime of the process.
So I created a parent runtime before every other to make sure there was no race when initializing global data.

And there was some segfault because of undefined DEBUG (js-config.h only defines JS_DEBUG, but DEBUG is used in some public headers, is that a bug?).

Finally there was some more assertion failures but they were the kind I was expecting from a debug build in order to fix my code.

Thanks for your help.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.