Re: weird assertion failure in js::NewContext (JS60)

[email protected] Thu, 28 Mar 2019 10:29:34 -0700 (PDT)
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
On Wednesday, March 27, 2019 at 5:40:45 PM UTC-4, Kent Williams wrote:
> This is an app that embeds JS60 SpiderMonkey (checked out from github 
> and based on the the JS60 release tag)
> 
> The same code seems to work fine in a bunch of my own tests.  I passed 
> it off to another programmer, and he somehow gets it to segfault.
> 
> My mystery is that the stuff he's doing follows EXACTLY the same path 
> into the SpiderMonkey code as everything else I've done.
> 
> The crash comes on this line:
> 
>      MOZ_RELEASE_ASSERT(!TlsContext.get());
> 
> at the top of js::NewContext()
> 
> I don't know what TlsContext.get() is supposed to return, except in this 
> case it's returning NULL/nullptr.
> 
> Any clues.

The TlsContext here is an accessor for the JSContext bound to the current thread. The assert is checking that there currently is no existing JSContext and suggests that the js::NewContext() was called twice on the same thread.

--Ted
_______________________________________________
dev-tech-js-engine mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine