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
Crashes on rustc 1.67 #40
Comments
Interesting; so i'm not able to repro this on archlinux. A segfault is quite surprising, even more so since the function it's crashing in has no unsafe, nor in that module afaics: https://docs.rs/prettytable/latest/src/prettytable/lib.rs.html nor in https://docs.rs/prettytable/latest/src/prettytable/lib.rs.html (the table what rustc are you using to compile and also to cargo install? You didn't receive the bingrep binary from somewhere else right? |
I just saw that you're compiling with nightly? have you tried building with stable rust? if that also segfaults then it's not nightly, but it's not inconceivable nightly rust could be miscompiling something (albeit highly unlikely)? |
I have now tried stable Rust and it still crashes. It's the same on my Intel and my AMD computers. I ran everything again in Docker so that it would be a clean setup, and more reproducible for you. Attached is the console output. EDIT: This also happens on EDIT2: I've tested both Konsole and xterm. This also happens on archlinux: bingrepdockerarch.txt EDIT3: Also happens on |
something seems very wrong, your bingrepdockerarch.txt says it crashes on this line with a segfault: https://docs.rs/prettytable/latest/src/prettytable/cell.rs.html#197 |
wow ok i just repro'd this on an older ubuntu machine i have sitting around, fresh clone, fresh rustup... this is pretty wild! i''m at a loss at the moment what could be the issue here |
I have a similar backtrace in debug:
|
ok this is worrisome, if i:
it runs without issue. so this looks like this could be a regression in rustc compiler somehow? |
What happens if you run it under valgrind? You may need to compile the latest valgrind from source. Newer rustc use DWARF5 for debuginfo which older valgrind don't understand. Alternatively |
Ok rustc 1.66.0 also runs fine for me, but 1.67.0 segfaults. I'm (shockingly) leaning more towards this being a rustc miscompile?
@danielzgtg could you confirm if 1.66.0 runs fine for you? |
@bjorn3 here is valgrind output with strip debug info as you suggested:
|
this might be the cause? phsym/prettytable-rs#145 |
Yes. I confirm that 1.66.0 works for me. It might not necessarily be a regression in the rust compiler. There might be undefined behavior in any of the lines of code anywhere in the program executed before the crash. It could have been silent corruption for previous rustc versions, and in the latest version the compiler could have perfectly legally decided to move things around, exposing the undefined behavior. |
yes i think the issue i linked is the cause and rustc 1.67 just happened to start exploiting that UB in the crate. quite a bummer :/ |
i just ported bingrep to prettytable 0.10 and it runs without issue on 1.67.0 |
so when i pushed the update to 0.10, github printed out this link: https://github.com/m4b/bingrep/security/dependabot/2 but i don't think i was ever notified about this issue, which says it was 1 month ago :/ anyway this should be fixed now and published as 0.10.3 |
Everything is working again after downloading your fixed version with |
thanks for the great bug report and carefully curated logs, was very helpful! i just wish i saw the dependabot security notice sooner (it's actually quite cool that github publishes known rustsec things onto a security tab) |
bingrep
segfaults on everything:It happens whether built from 8596f7f or if v0.10.2 is
cargo install
ed. It crashes on itself,ls
, andcat
.Here is the debug debugging output:
Here is the release debugging output:
The text was updated successfully, but these errors were encountered: