From:  slogan621@gmail.com
Date:  24 Jan 2008 08:18:42 Hong Kong Time
Newsgroup:  news.mozilla.org/netscape.public.mozilla.jseng
Subject:  

Re: fp->scopeChain == fp->varobj assert firing

NNTP-Posting-Host:  70.164.99.62

I resolved this. It had to do with how I was managing global context.
But no worries if someone wants to respond more authoritatively on the
subject for the benefit of others.

syd

On Jan 23, 10:06 am, slogan...@gmail.com wrote:
> I'm upgrading my application which embeds SpiderMonkey to the current
> (trunk) js engine (libmozjs) from something I had pulled about a year
> or so ago.  Up until the upgrade, things had been working fine -- I
> could parse and execute scripts embedded in my documents, with no
> apparent problems.
>
> In upgrading, one of the things I needed to do was compile with
> JS_THREADSAFE on, and wrap most calls to the JS API with either
> JSAutoRequest or JS_StartRequest/JS_EndRequest blocks. This is because
> I was getting asserts (CHECK_REQUEST is the macro I believe). I've
> been working through these one by one, though it is pretty clear to me
> what is going on and where these wrappings are needed.
>
> My current problem is an assert that fires in the JS interpreter, when
> I compile and  execute script:
>
> fp->scopeChain == fp->varobj at jsinterp.c:4617
>
> My code, is (paraphrasing):
>
> JS_BeginRequest(ctx);
> script = JS_CompileFile(ctx, obj, path);
> if (script) {
>    JS_AddRoot(ctx, &script);
>    JS_ExecuteScript(ctx, obj, script, &rval);}
>
> JS_EndRequest(ctx);
>
> My supposition is that one or both of the ctx or obj arguments to
> either JS_CompileFile or JS_ExecuteScript are contributing to the
> problem.
>
> Question is, what are the conditions implied by the assert?
>
> This assert was added about a month ago. I'm wondering what sorts of
> problems this