Closed Bug 1281730 Opened 4 years ago Closed 4 years ago
Workers and set
Timeout ⇒ "Assertion failure: !Is Null() (Cannot compute with a null value)" within ns Global Window::Insert Timeout Into List
Assertion failure: !IsNull() (Cannot compute with a null value), at TimeStamp.h:551
Ben, WDYT about this assertion?
Priority: -- → P3
I haven't really looked at this yet, but I can tell you opening the attached test case leaks its window.
So the issue here is that the timers were suspended on the window. In nsGlobalWindow::ResumeTimers() we thaw workers and then fixup the timer instances. With this test case, though, there is a pending message event from the worker which immediately calls setTimeout(). This then blows up because the timer objects still are in their frozen state with mValues of 0. I think the safest thing to do here is to simply restore the timers before thawing the workers. Any timer initialized in this process should run in a new runnable on the main thread and therefore won't execute before the worker thaw process. I also considered making the worker thaw process asynchronous, but there are comments about strict ordering of the frozen events vs the worker thread running, so that did not seem as safe. This patch fixes the issue locally for me. I'll do a try run next to verify it doesn't break something else.
Assignee: nobody → bkelly
Status: NEW → ASSIGNED
Attachment #8767276 - Flags: review?(khuey)
Attachment #8767276 - Flags: review?(khuey) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/98f89b579438 Restore timeouts before thawing workers to avoid running script on frozen timers. r=khuey
You need to log in before you can comment on or make changes to this bug.