-
Notifications
You must be signed in to change notification settings - Fork 262
Make Miri backtraces work with #[global_allocator] #462
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me, but how would you like this to get landed? The CI here is failing presumably because miri needs an update, but does the lack of changes here block a miri update?
9e82791
to
72f0309
Compare
The new approach should avoid this blocking problem by being backwards compatible with old code |
Make backtraces work with #[global_allocator] Currently, backtraces break when the global allocator is overridden because the allocator will attempt to deallocate memory allocated directly by Miri. ~~This PR fixes that by using a new memory kind and providing a function to deallocate it. We can't call the custom allocator to allocate because it's not possible to call a function in the middle of a shim.~~ This PR fixes that by adding a new version of the backtrace API accessible by setting `flags` to 1. Existing code still functions. backtrace-rs PR: rust-lang/backtrace-rs#462 Fixes #1996
Alright, should be updated for the final version of rust-lang/miri#1975 |
But I forgot that this won't pass yet until next nightly with miri on it 🙃 |
First the Miri submodule needs to be updated. :) rust-lang/rust#95144 does that. |
@drmeepster you could try rebasing so that CI picks up the new Miri? Then we'll see if this works as it should. |
Whoops! I forgot about this completely, sorry. |
Miri CI is green, so LGTM. :) But I cannot land PRs here. |
🎉 :-) @alexcrichton what does it take to get this into rustc? |
I believe the |
update libbacktrace It seems like previously we were on a tag of the backtrace repo; not sure if there is a policy that it should always be a tag? Cc rust-lang/backtrace-rs#462 `@alexcrichton` `@DrMeepster`
update libbacktrace It seems like previously we were on a tag of the backtrace repo; not sure if there is a policy that it should always be a tag? Cc rust-lang/backtrace-rs#462 `@alexcrichton` `@DrMeepster`
Supports changes in rust-lang/miri#1975