Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Race condition in JS #29
We had to add the debugger to the window context factory in order to workaround a race condition in the JS library.
But it is commented out in the ugly patches because it seemed to be not required anymore.
However, the race condition appeared again today.
Quick testing shows that using a dummy debugger works fine. But needs more testing.
The problem surfaced again on Reddit
The good news is that the problem seemed to go away after using a dummy debugger that returns dummy frames (instead of just null frames). If this is confirmed, no extra permissions would be required.
Have opened an upstream thread
I was able to pin down the root-cause. There is code to set the parent scope of an object, when that object is being returned to JS. Sometimes the
I was able to determine atleast one instance where this happens, and coded it to a test-case
I am yet to code the part that causes the infinite loop (if there is no fix to the first part). Anything that walks the parent scope chain should work.
A fix has been committed to the ugly-patches branch. It consists of a simple check before setting the parent-scope of