Assert on exit after starting a worker and immediately exiting.

REOPENED
Assigned to

Status

Tamarin
Workers
P3
normal
REOPENED
6 years ago
6 years ago

People

(Reporter: Chris Peyer, Assigned: Krzysztof Palacz)

Tracking

(Blocks: 1 bug)

unspecified
Q2 12 - Cyril
x86
All
Bug Flags:
in-testsuite +
flashplayer-injection -
flashplayer-qrb +
flashplayer-bug -

Details

Attachments

(2 attachments)

(Reporter)

Description

6 years ago
Run attached testcase.

Results in:

ReferenceError: Error #1065: Variable not_defined is not defined.
Assertion failed: "((incChannel->gc() != __null))" ("../core/WorkerGlue.cpp":317)
Trace/BPT trap

The ReferenceError is expected, but code should not assert on exit.
Flags: in-testsuite+
Flags: flashplayer-injection-
Flags: flashplayer-bug-
(Reporter)

Comment 1

6 years ago
ReferenceError is actually not relevant to the assert.  Testcase has been updated to simplest testcase.
Summary: Assert on exit when attempting to resolve undefined function. → Assert on exit after starting a worker and immediately exiting.
(Reporter)

Comment 2

6 years ago
Created attachment 551527 [details]
testcase

Updated

6 years ago
Assignee: nobody → kpalacz
Flags: flashplayer-qrb+
Priority: -- → P3
Target Milestone: --- → Q2 12 - Cyril

Comment 3

6 years ago
I did not reproduce the bug with the current workers code.  If I use the code:
import flash.system.*
var w:Worker = WorkerDomain.current.createWorkerFromPrimordial();
print(w);
var p:Promise = w.start();
w.exit();

after 32 workers on my macbook I reach the worker limit and on _d builds I get an assertion.   
Error: Worker limit reached
Assertion failed: "((!m_roots))" ("../MMgc/GC.cpp":420)
Trace/BPT trap: 5

On release builds after the Worker limit is reached the shell exits with exit code 0.

If I exit immediately after start I do not see any problems, the test works as expected.
import flash.system.*

var w:Worker = WorkerDomain.current.createWorkerFromPrimordial();
if (Worker.current.isPrimordial()) {
   var p:Promise = w.start();
   w.exit();
}

Updated

6 years ago
Depends on: 695061

Comment 4

6 years ago
The reason for the assertion firing was that the worker was being asked to shutdown before it was fully initialized. The assertion has been augmented with a check for shutdown request.
Assignee: kpalacz → awelc
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Comment 5

6 years ago
in debug builds I still see the assertion:
Error: Worker limit reached
Assertion failed: "((!m_roots))" ("../MMgc/GC.cpp":420)
Trace/BPT trap: 5

I'm using the code:

var w:Worker = WorkerDomain.current.createWorkerFromPrimordial();
var promise:Promise = w.start();
var result;
try {
    result = not_defined.local::receive();
} catch (e) {
    result = e.toString();
}

Updated

6 years ago
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 6

6 years ago
I am reassigning this bug to Krzysztof as it seems to have something to do with the worker's lifecycle. I believe that the assertion is triggered because after the exception is thrown by the background worker, worker cleanup is not performed correctly resulting in some GC roots still remaining at the point of GC destruction. I tried explicitly cleaning up worker's channels but it does not seem to be enough.
Assignee: awelc → kpalacz

Comment 7

6 years ago
Created attachment 572090 [details]
test to trigger the GC assertion
(Assignee)

Comment 8

6 years ago
After recent changes to the worker lifecycle the assert is not triggered any more
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED

Updated

6 years ago
Blocks: 695061
No longer depends on: 695061

Comment 9

6 years ago
windows 64 exits with exit code 1 intermittently...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 10

6 years ago
changeset: 7397:f09b425761b5
user:      Dan Schaffer <Dan.Schaffer@adobe.com>
summary:   bug 677333: regression test in failing intermittently on win64

http://hg.mozilla.org/tamarin-redux/rev/f09b425761b5

Comment 11

6 years ago
changeset: 7411:0415347eefb5
user:      Brent Baker <brbaker@adobe.com>
summary:   bug 677333: previous change (CL@1064610) to skip test had the path incorrect, this will correctly skip the testcase on all x64-win runs (p=brbaker)

http://hg.mozilla.org/tamarin-redux/rev/0415347eefb5
You need to log in before you can comment on or make changes to this bug.