[Webkit-unassigned] [Bug 180499] ASSERTION FAILED: m_workerGlobalScope->hasOneRef()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 6 14:50:47 PST 2017


--- Comment #3 from youenn fablet <youennf at gmail.com> ---
Looking at CryptoKeyRSA::generatePair, it does the following:
- ref the ScriptExecutionContext in a thread T1
- dispatch to a thread T2
- execute a task in T2
- go back to the original thread T1
- unref the ScriptExecutionContext.

I do not believe this works in practice since T1 may be stopped when executing T2 task.
Refing the context will not help going back to T1 in that case.
This is probably why we are hitting that assertion.

Also, since we might not be able to go back to T1, we should not ref anything in the callbacks otherwise, they might be destroyed in the wrong thread.

For instance, SubtleCrypto::generateKey callbacks are capturing promises.
It might be better to keep a ref of the promise in SubtleCrypto and keep a weak ref to it. Then you can probably get SubtleCrypto from the ScriptExecutionContext on the way back.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20171206/0c000da6/attachment.html>

More information about the webkit-unassigned mailing list