New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of get_cx can fail after clearing JS runtime #21866
Comments
An example of what this looks like:
|
Related to #21419, and in general lots of code which assumes browsing contexts are never discarded. |
How can I reproduce this on local? |
Also, when you mean the global, do you mean all the tasks submitted through GlobalScope.pipeline_id? |
You may be lucky enough to be able to trigger this (potentially) intermittent failure by running |
Sorry, I have more questions: How can I get a list of such a tasks? I have been taking a look at the |
There's no way to get such a list without looking at each use of CommonScriptMsg::Task, as far as I can tell. It shouldn't be necessary to modify any of them, though; we built our task cancellation mechanism that you've been improving to enable this use case - if we use the API that marks all task sources as cancelled then any outstanding tasks for those sources will be ignored. |
@AgustinCB Here are a few more pointers, hopefully they're correct and useful:
So the way to think about how this is processed is that:
Hope this helps(and that if changing the ordering really is the fix, it didn't spoil the fun)! |
Using window.get_cx can trigger a script thread panic when it runs as part of a task that affects a global that already had its runtime cleared. We can avoid this by cancelling all outstanding tasks for the global as part of Window::clear_js_runtime.
The text was updated successfully, but these errors were encountered: