Skip to content
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

Avoid leaking outstanding Trusted values when tearing down a script task #5907

Open
jdm opened this issue Apr 30, 2015 · 4 comments
Open

Avoid leaking outstanding Trusted values when tearing down a script task #5907

jdm opened this issue Apr 30, 2015 · 4 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Apr 30, 2015

We have a table of explicit roots for trusted values in TLS. Besides storing the reference count there, we could also store a boolean value that indicates whether the root is still valid. All of the methods in Trusted could check that boolean value and panic if it's false - this would take down any non-script task that tried to clone one, or dropped the final reference to one, and would catch any invalid cases in the script task that tried to root Trusted values after they are no longer valid. By adding these checks, we could clear the TLS table before destroying the runtime, thereby invalidating outstanding long-term roots for JS values.

@jdm
Copy link
Member Author

@jdm jdm commented Apr 30, 2015

@jdm
Copy link
Member Author

@jdm jdm commented Apr 30, 2015

The alternative is that we could simply rely on the failure of sending messages to the script task to deal with this, under the assumption that we clear the TLS table immediately before destroying the runtime and guarantee that we will not process any further events in the script task after doing so.

@nox
Copy link
Member

@nox nox commented Sep 30, 2017

@jdm Don't we clear that TLS table now?

@jdm
Copy link
Member Author

@jdm jdm commented Sep 30, 2017

No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.