Closed Bug 853850 Opened 11 years ago Closed 2 years ago

Cannot create a new context in an empty runtime

Categories

(Core :: JavaScript Engine, defect)

17 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: rehrlich, Unassigned)

Details

User Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.2)

Steps to reproduce:

A new runtime is created and a context created in it. Then the 
context is deleted. When another new context is created in that runtime , an assertion error is thrown because the second creation of the new context 
thinks it is the first time this runtime is being used.



Actual results:

An assertion error is thrown.


Expected results:

The new context should be created.

A new flag is needed to note that this runtime needs to be initialized. Using the fact that no context exists is not correct.

See jscntxt.cpp:line 336
bool first = JS_CLIST_IS_EMPTY(&rt->contextList);

and

line 348
    if (first) {
#ifdef JS_THREADSAFE
        JS_BeginRequest(cx);
#endif
        bool ok = rt->staticStrings.init(cx);
        if (ok)
            ok = InitCommonAtoms(cx);
        if (ok)
            ok = rt->initSelfHosting(cx);

initSelfHosting generates the assertion failure.
Assignee: general → nobody
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.