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

Stable MIR's thread local not properly handled on unwind #112940

Closed
programmerjake opened this issue Jun 22, 2023 · 2 comments · Fixed by #113251
Closed

Stable MIR's thread local not properly handled on unwind #112940

programmerjake opened this issue Jun 22, 2023 · 2 comments · Fixed by #113251
Assignees
Labels
E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@programmerjake
Copy link
Member

f();
TLV.replace(std::ptr::null_mut());

TLV is left set to a dangling pointer if f unwinds. This is unsound because a later call to with will use that dangling pointer. There is a similar issue with with and unwinding.

since you're on the Stable MIR cc list:
cc @oli-obk, @celinval

@programmerjake
Copy link
Member Author

if you can add it as a dependency, using scoped-tls would probably be better than rolling your own version.

@oli-obk
Copy link
Contributor

oli-obk commented Jun 23, 2023

using scoped-tls

Yea, that makes sense. I think we should look into using it for the tls module, too, which is how we get a TyCtxt within the compiler itself

@oli-obk oli-obk added E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 23, 2023
@chenyukang chenyukang assigned chenyukang and unassigned chenyukang Jun 29, 2023
@bors bors closed this as completed in d3fae79 Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants