-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Segfault on no-std binary on 1.72.0, since nightly 2023-06-17 #115225
Comments
It looks like |
Oh, Interesting, I'll look into that, thanks for the lead! |
I had a few lazy attempts at trying to inline, uninline, asm, global_asm, but haven't been able to work around this, as you said |
There should be flags passed to C compilers to disable this. You can maybe pass them as |
I am a bit out of my depth here, but I previously encountered something similar https://users.rust-lang.org/t/reliably-working-around-rust-emitting-memset-when-putting-a-slice-on-the-stack/97080/6. |
Compiler-builtins uses |
Ah I see, yeah the reason for not using it is because I won't be able to compile on stable if I do, compiler builtins uses a bunch of features that are never planned for stabilization so then I'd need to be on nightly forever. Previously this was fine on stable, I just needed to provide the symbols |
|
Summary
I've written a tiny-stdlib that works without libc, binaries produced by it seems to be broken per nightly-2023-06-17 and forward.
A small repro can be found here.
Running gdb on the binary shows:
It's actually in this line that it breaks, but in the copied version here which hasn't changed in compiler builtins since.
It could be that I have UB somewhere, or something about the emission of that memset changed between those times.
I'll try to search further but maybe this rings a bell somewhere.
Code
I tried this code:
I expected to see this happen: No segfault
Instead, this happened: Sefault
Version it worked on
It most recently worked on: 1.71.0 and
nightly-2023-06-16
Version with regression
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: