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

Corrupt backtrace printing #69924

Closed
bjorn3 opened this issue Mar 11, 2020 · 3 comments
Closed

Corrupt backtrace printing #69924

bjorn3 opened this issue Mar 11, 2020 · 3 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Mar 11, 2020

The panic is caused by a problem in my code, but I expected a backtrace without garbage like U▒.

$ rustc -V
rustc 1.43.0-nightly (3dbade652 2020-03-09)
$ git clone https://github.com/bjorn3/rustc_codegen_cranelift
$ cd rustc_codegen_cranelift
$ git checkout 3e111967d297173b410ed4ad174e5bb0379ed6a2
$ ./prepare.sh && ./test.sh
$ # You can abort the previous command once hyperfine is running
$ cd simple-raytracer
$ CG_CLIF_INCR_CACHE=1 ../cargo.sh build
$ rm target/x86_64-unknown-linux-gnu/debug/deps/libraytracer-*.rlib
$ CG_CLIF_INCR_CACHE=1 ../cargo.sh build
$ # The broken backtrace

Sorry for the long repro steps. I don't know how to reduce this.

thread 'rustc' panicked at 'LTO unsupported', src/driver.rs:291:38
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1063
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1428
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
  12: is_prefix_of17h94b348dc8c888b79E
  13: teral4span17h10eecf4264bfcf69E
  14: U▒
  15: core::iter::traits::iterator::Iterator::fold::ok::{{closure}}
  16: core::iter::traits::iterator::Iterator::try_fold
  17: 
  18: U▒
  19: 
  20: 
  21: �/
  22: 
  23: oc_macro28fallback5Ident4span17h67e781d6d0fd26b5E
  24: f9b2563E
  25: macro26strnom6Cursor4find17h96007a5d5e73adc2E
  26: into_iter28_$u7b$$u7b$closure$u7d$$u7d$17he06b301940fa9f5cE
  27: cept_table107
  28: rustc_codegen_cranelift::driver::codegen_crate
  29: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  30: rustc_interface::passes::start_codegen
  31: rustc::ty::context::tls::enter_global
  32: rustc_interface::queries::Queries::ongoing_codegen
  33: rustc_interface::interface::run_compiler_in_existing_thread_pool
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.43.0-nightly (3dbade652 2020-03-09) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z panic-abort-tests -Z codegen-backend=/home/bjorn/Documenten/cg_clif/target/debug/librustc_codegen_cranelift.so -C debuginfo=2 -C incremental -C panic=abort -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

(bjorn3/rustc_codegen_cranelift@3e11196 keep alive for this commit)

@bjorn3 bjorn3 added the C-bug Category: This is a bug. label Mar 11, 2020
@jonas-schievink jonas-schievink added A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Mar 11, 2020
@Aaron1011
Copy link
Member

@bjorn3: Can you check if this is an instance of #69151 (i.e. the debuginfo is too large)?

@bjorn3
Copy link
Member Author

bjorn3 commented Mar 11, 2020

The total size of the target dir is less than 2GB, so debuginfo shouldn't be too large.

@Centril Centril added A-cranelift Things relevant to the [future] cranelift backend and removed A-cranelift Things relevant to the [future] cranelift backend labels Mar 12, 2020
@jyn514 jyn514 added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jul 4, 2023
@bjorn3
Copy link
Member Author

bjorn3 commented Jul 1, 2024

Haven't seen this since.

@bjorn3 bjorn3 closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants