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

fix: set RUST_BACKTRACE outside of the panic hook #80

Merged
merged 1 commit into from
Oct 20, 2024
Merged

Conversation

DaniPopes
Copy link
Member

set_var is unsafe in multi-threaded programs. The panic hook can be called from multiple threads at the same time, thus its use is unsafe inside of it. Move it to when registering the panic hook which is generally called at the start of the program when only 1 thread is running.

@DaniPopes DaniPopes added the C-cleanup Category: PRs that clean code up or issues documenting cleanup label Oct 20, 2024
Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@DaniPopes DaniPopes merged commit bd1dc0e into main Oct 20, 2024
11 checks passed
@DaniPopes DaniPopes deleted the dani/set-var branch October 20, 2024 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants