Cannot create a new context in an empty runtime

UNCONFIRMED
Unassigned

Status

()

Core
JavaScript Engine
UNCONFIRMED
5 years ago
4 years ago

People

(Reporter: Robin Ehrlich, Unassigned)

Tracking

17 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
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)

Updated

4 years ago
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.