-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Regression in global_allocator when using prefer-dynamic on 1.71.0 and above #114518
Comments
As far as I understand this shouldn't work on Windows ever before my PR as on Windows symbol preemption across dll's doesn't happen, so inside std.dll it would resolve |
This is happening for me on macOS and Linux. What is odd if that cc above is accurate is that |
I mean it should always have been broken on Windows as far as I understand and now is broken on other platforms too. |
Ah right gotcha, just did not get why Windows was being brought in scope but then again I was not clear that linux was my deployment target and macos my development target. Is there anything I can do to help you fix the regression? |
When I wrote #86844 I expected rustc to error on use std::alloc::*;
struct MyAlloc;
unsafe impl GlobalAlloc for MyAlloc {
unsafe fn alloc(&self, _: Layout) -> *mut u8 { todo!() }
unsafe fn dealloc(&self, _: *mut u8, _: Layout) { todo!() }
}
#[global_allocator]
static ALLOC: MyAlloc = MyAlloc;
fn main() {
Box::new(0);
} and |
So basically on |
Yes |
Removing the prioritization label as the comments seem to point out that now this is the intended behaviour. Though probably can be surprising to some users, so I wonder about the actionable here. @rustbot label -I-prioritize |
@apiraino surely its important to get the compiler to throw an error here or people are going to get unexpected segfaults. This is probably not that apparent due to the rare use of both features, but rustc is now creating invalid binaries. |
ok @alexkornitzer so what would be the desired behaviour in 1.71.0 instead of crashing? Some kind of safeguard preventing it (and maybe giving useful info to the user)? Thanks for helping me figuring the context :-) |
Yeah that would be ideal, which I think is what @bjorn3 suggested but never actioned? (#100781 (comment)) |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
Since 1.71.0 a regression has been added into the compiler causing segmentation faults in applications compiled using
prefer-dynamic
, this issue is not present in 1.70.0. It appears that the system allocator is still being used in some cases causing segmentation faults.Code
https://github.com/alexkornitzer/dylib-errors/tree/error/jemalloc
Version it worked on
It most recently worked on: 1.70.0
Version with regression
1.71.0
Have run git bisect and the regression was introduced with the following commit: a2b1646
The text was updated successfully, but these errors were encountered: