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

Infinite/long backtrace on i686 under Wine #135717

Open
purplesyringa opened this issue Jan 19, 2025 · 5 comments · May be fixed by #135804
Open

Infinite/long backtrace on i686 under Wine #135717

purplesyringa opened this issue Jan 19, 2025 · 5 comments · May be fixed by #135804
Labels
A-backtrace Area: Backtraces A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-panic Area: Panicking machinery 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-investigation Call for partcipation: This issues needs some investigation to determine current status O-windows Operating system: Windows O-x86_32 Target: x86 processors, 32 bit (like i686-*) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@purplesyringa
Copy link
Contributor

purplesyringa commented Jan 19, 2025

I'm not sure where to file this bug, but it affects Rust more than other languages for reasons explained below, so let's at least make this visible here.

I tried running this code:

fn main() {
    panic!("Hello, world!");
}

with RUST_BACKTRACE=full under Wine.

I expected to see this happen: a short backtrace.

Instead, this happened: an infinite backtrace on i686-pc-windows-msvc and a finite, but longer than necessary, repetitive, and clearly wrong backtrace on i686-pc-windows-gnu.

This might not seem like much (does anyone use RUST_BACKTRACE=full in production?), but Rust forces a full backtrace on double panic, so panics in destructors effectively hang the process instead of aborting it. Beautiful.

I think it's fair to say that this is likely a Wine bug, however, I think it's also possible that LLVM generates wrong SEH frames, which Windows handles correctly only by chance. As a workaround, we might want to somewhat limit the backtrace length even on double panic?

Meta

rustc --version --verbose:

rustc 1.86.0-nightly (419b3e2d3 2025-01-15)
binary: rustc
commit-hash: 419b3e2d3e350822550eee0e82eeded4d324d584
commit-date: 2025-01-15
host: x86_64-unknown-linux-gnu
release: 1.86.0-nightly
LLVM version: 19.1.6

wine --version: wine-9.22 (Staging)

I'm cross-compiling for Windows with cargo-xwin for MSVC ABI and cross for GNU ABI:

  • XWIN_ARCH=x86 RUST_BACKTRACE=full cargo xwin run --target i686-pc-windows-msvc
  • RUST_BACKTRACE=full cross run --target i686-pc-windows-gnu

...but I have checked that the problem can be reproduced with executables built natively on Windows.

RUST_BACKTRACE=full backtrace on MSVC

thread 'main' panicked at src/main.rs:10:5:
Hello, world!
stack backtrace:
0024:fixme:dbghelp:i386_stack_walk new PC=833875c0 different from Eip=40b4ab
   0:   0x40b4ab - fmt
   1:   0x40b4ab - core::fmt::write
[the above lines repeated endlessly, with nothing but the frame depth changing]

RUST_BACKTRACE=full backtrace on GNU

thread 'main' panicked at src/main.rs:10:5:
Hello, world!
stack backtrace:
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp:elf_search_auxv can't find symbol in module
015c:fixme:dbghelp_dwarf:dwarf2_parse_udt_type Unhandled Tag type 0x33 at debug_info(abbrev:014D0610,symt:011EE5A0) in ctx(011E05E0,L"cringe")
015c:fixme:dbghelp_dwarf:dwarf2_parse_udt_type Unhandled Tag type 0x33 at debug_info(abbrev:014D0610,symt:011EE620) in ctx(011E05E0,L"cringe")
015c:fixme:dbghelp_dwarf:dwarf2_parse_udt_type Unhandled Tag type 0x33 at debug_info(abbrev:014D0610,symt:011EE720) in ctx(011E05E0,L"cringe")
015c:fixme:dbghelp_dwarf:dwarf2_parse_udt_type Unhandled Tag type 0x33 at debug_info(abbrev:014D0610,symt:025000B8) in ctx(011E05E0,L"cringe")
015c:fixme:dbghelp_dwarf:dwarf2_parse_udt_type Unhandled Tag type 0x33 at debug_info(abbrev:014D0610,symt:02500138) in ctx(011E05E0,L"cringe")
015c:fixme:dbghelp_dwarf:dwarf2_parse_udt_type Unhandled Tag type 0x33 at debug_info(abbrev:014D0610,symt:02500238) in ctx(011E05E0,L"cringe")
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
   0:   0x48406b - core::fmt::rt::Argument::fmt::h8360d965bd1e2b6e
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\fmt/rt.rs:177:76
   1:   0x48406b - core::fmt::write::hd923a73d9d161bb0
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\fmt/mod.rs:1440:21
   2:   0x48406b - core::fmt::rt::Argument::fmt::h8360d965bd1e2b6e
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\fmt/rt.rs:177:76
   3:   0x48406b - core::fmt::write::hd923a73d9d161bb0
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\fmt/mod.rs:1440:21
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
   4:   0x434015 - std::io::Write::write_fmt::had1d59cd6160ac1d
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src\io/mod.rs:1887:15
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
   5:   0x43dd85 - std::sys::backtrace::BacktraceLock::print::hd49d4d80db29b827
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src\sys/backtrace.rs:42:9
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
   6:   0x440387 - std::panicking::default_hook::{{closure}}::hd20fad6770713ea0
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:298:22
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
   7:   0x4401d0 - std::panicking::default_hook::h1a8c8518394b8a18
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:325:9
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
   8:   0x440df5 - std::panicking::rust_panic_with_hook::h9da62b45b00ce8e2
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:831:13
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
   9:   0x440b84 - std::panicking::begin_panic_handler::{{closure}}::h2f73c259c0a62ae3
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:697:13
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
  10:   0x43e8ab - std::sys::backtrace::__rust_end_short_backtrace::h8d127ac41d00cbaf
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src\sys/backtrace.rs:168:18
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
  11:   0x4408ae - rust_begin_unwind
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:695:5
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
  12:   0x4806f1 - core::panicking::panic_fmt::hffd0c350f3e911e2
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src/panicking.rs:75:14
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
  13:   0x40166f - cringe::main::he8e076d3e00c6e43
                       at /home/purplesyringa/cringe/src/main.rs:10:5
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
  14:   0x401809 - core::ops::function::FnOnce::call_once::hab1ff5b455ae04c6
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584\library\core\src\ops\function.rs:250:5
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
  15:   0x401791 - std::sys::backtrace::__rust_begin_short_backtrace::hf837e3a1102d85cf
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584\library\std\src\sys\backtrace.rs:152:18
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
  16:   0x401773 - std::rt::lang_start::{{closure}}::h0ed424ef8b484891
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584\library\std\src\rt.rs:194:18
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
  17:   0x426745 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h8eb84feb54c9cb1d
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\ops/function.rs:284:13
  18:   0x426745 - std::panicking::try::do_call::hfdc2187cea17d7ae
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  19:   0x426745 - std::panicking::try::h906cdc33b1ce235a
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  20:   0x426745 - std::panic::catch_unwind::he80bb62fbfbcf0ee
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  21:   0x426745 - std::rt::lang_start_internal::{{closure}}::h66a7d6bdfa5b0443
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:163:24
  22:   0x426745 - std::panicking::try::do_call::hbe592467235de060
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  23:   0x426745 - std::panicking::try::h887ebabf70af544c
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  24:   0x426745 - std::panic::catch_unwind::he0bcf444777fac47
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  25:   0x426745 - std::rt::lang_start_internal::hf4c77c5234ec0509
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:159:5
  26:   0x426745 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h8eb84feb54c9cb1d
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\ops/function.rs:284:13
  27:   0x426745 - std::panicking::try::do_call::hfdc2187cea17d7ae
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  28:   0x426745 - std::panicking::try::h906cdc33b1ce235a
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  29:   0x426745 - std::panic::catch_unwind::he80bb62fbfbcf0ee
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  30:   0x426745 - std::rt::lang_start_internal::{{closure}}::h66a7d6bdfa5b0443
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:163:24
  31:   0x426745 - std::panicking::try::do_call::hbe592467235de060
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  32:   0x426745 - std::panicking::try::h887ebabf70af544c
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  33:   0x426745 - std::panic::catch_unwind::he0bcf444777fac47
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  34:   0x426745 - std::rt::lang_start_internal::hf4c77c5234ec0509
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:159:5
  35:   0x426745 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h8eb84feb54c9cb1d
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\ops/function.rs:284:13
  36:   0x426745 - std::panicking::try::do_call::hfdc2187cea17d7ae
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  37:   0x426745 - std::panicking::try::h906cdc33b1ce235a
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  38:   0x426745 - std::panic::catch_unwind::he80bb62fbfbcf0ee
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  39:   0x426745 - std::rt::lang_start_internal::{{closure}}::h66a7d6bdfa5b0443
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:163:24
  40:   0x426745 - std::panicking::try::do_call::hbe592467235de060
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  41:   0x426745 - std::panicking::try::h887ebabf70af544c
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  42:   0x426745 - std::panic::catch_unwind::he0bcf444777fac47
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  43:   0x426745 - std::rt::lang_start_internal::hf4c77c5234ec0509
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:159:5
  44:   0x426745 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h8eb84feb54c9cb1d
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\ops/function.rs:284:13
  45:   0x426745 - std::panicking::try::do_call::hfdc2187cea17d7ae
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  46:   0x426745 - std::panicking::try::h906cdc33b1ce235a
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  47:   0x426745 - std::panic::catch_unwind::he80bb62fbfbcf0ee
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  48:   0x426745 - std::rt::lang_start_internal::{{closure}}::h66a7d6bdfa5b0443
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:163:24
  49:   0x426745 - std::panicking::try::do_call::hbe592467235de060
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  50:   0x426745 - std::panicking::try::h887ebabf70af544c
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  51:   0x426745 - std::panic::catch_unwind::he0bcf444777fac47
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  52:   0x426745 - std::rt::lang_start_internal::hf4c77c5234ec0509
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:159:5
  53:   0x426745 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h8eb84feb54c9cb1d
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\ops/function.rs:284:13
  54:   0x426745 - std::panicking::try::do_call::hfdc2187cea17d7ae
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  55:   0x426745 - std::panicking::try::h906cdc33b1ce235a
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  56:   0x426745 - std::panic::catch_unwind::he80bb62fbfbcf0ee
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  57:   0x426745 - std::rt::lang_start_internal::{{closure}}::h66a7d6bdfa5b0443
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:163:24
  58:   0x426745 - std::panicking::try::do_call::hbe592467235de060
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  59:   0x426745 - std::panicking::try::h887ebabf70af544c
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  60:   0x426745 - std::panic::catch_unwind::he0bcf444777fac47
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  61:   0x426745 - std::rt::lang_start_internal::hf4c77c5234ec0509
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:159:5
  62:   0x426745 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h8eb84feb54c9cb1d
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\ops/function.rs:284:13
  63:   0x426745 - std::panicking::try::do_call::hfdc2187cea17d7ae
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  64:   0x426745 - std::panicking::try::h906cdc33b1ce235a
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  65:   0x426745 - std::panic::catch_unwind::he80bb62fbfbcf0ee
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  66:   0x426745 - std::rt::lang_start_internal::{{closure}}::h66a7d6bdfa5b0443
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:163:24
  67:   0x426745 - std::panicking::try::do_call::hbe592467235de060
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  68:   0x426745 - std::panicking::try::h887ebabf70af544c
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  69:   0x426745 - std::panic::catch_unwind::he0bcf444777fac47
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  70:   0x426745 - std::rt::lang_start_internal::hf4c77c5234ec0509
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:159:5
  71:   0x426745 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h8eb84feb54c9cb1d
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\ops/function.rs:284:13
  72:   0x426745 - std::panicking::try::do_call::hfdc2187cea17d7ae
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  73:   0x426745 - std::panicking::try::h906cdc33b1ce235a
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  74:   0x426745 - std::panic::catch_unwind::he80bb62fbfbcf0ee
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  75:   0x426745 - std::rt::lang_start_internal::{{closure}}::h66a7d6bdfa5b0443
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:163:24
  76:   0x426745 - std::panicking::try::do_call::hbe592467235de060
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  77:   0x426745 - std::panicking::try::h887ebabf70af544c
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  78:   0x426745 - std::panic::catch_unwind::he0bcf444777fac47
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  79:   0x426745 - std::rt::lang_start_internal::hf4c77c5234ec0509
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:159:5
  80:   0x426745 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h8eb84feb54c9cb1d
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\ops/function.rs:284:13
  81:   0x426745 - std::panicking::try::do_call::hfdc2187cea17d7ae
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  82:   0x426745 - std::panicking::try::h906cdc33b1ce235a
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  83:   0x426745 - std::panic::catch_unwind::he80bb62fbfbcf0ee
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  84:   0x426745 - std::rt::lang_start_internal::{{closure}}::h66a7d6bdfa5b0443
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:163:24
  85:   0x426745 - std::panicking::try::do_call::hbe592467235de060
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  86:   0x426745 - std::panicking::try::h887ebabf70af544c
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  87:   0x426745 - std::panic::catch_unwind::he0bcf444777fac47
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  88:   0x426745 - std::rt::lang_start_internal::hf4c77c5234ec0509
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:159:5
  89:   0x426745 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h8eb84feb54c9cb1d
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\core\src\ops/function.rs:284:13
  90:   0x426745 - std::panicking::try::do_call::hfdc2187cea17d7ae
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  91:   0x426745 - std::panicking::try::h906cdc33b1ce235a
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  92:   0x426745 - std::panic::catch_unwind::he80bb62fbfbcf0ee
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  93:   0x426745 - std::rt::lang_start_internal::{{closure}}::h66a7d6bdfa5b0443
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:163:24
  94:   0x426745 - std::panicking::try::do_call::hbe592467235de060
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:587:40
  95:   0x426745 - std::panicking::try::h887ebabf70af544c
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panicking.rs:550:19
  96:   0x426745 - std::panic::catch_unwind::he0bcf444777fac47
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/panic.rs:358:14
  97:   0x426745 - std::rt::lang_start_internal::hf4c77c5234ec0509
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584/library\std\src/rt.rs:159:5
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
  98:   0x40174b - std::rt::lang_start::h59c4269b4dacd45e
                       at /rustc/419b3e2d3e350822550eee0e82eeded4d324d584\library\std\src\rt.rs:193:5
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
  99:   0x4016ae - _main
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
 100:   0x401386 - __tmainCRTStartup
                       at ./build/i686-w64-mingw32-i686-w64-mingw32-crt/./mingw-w64-crt/crt/crtexe.c:339:15
015c:fixme:dbghelp_dwarf:parse_cie_details unknown CIE version 20 at 019E5928
 101: 0x785194c0 - @BaseThreadInitThunk@12
 102: 0x786c9aa3 - _call_thread_func_wrapper
 103: 0x786caef2 - call_thread_func
                       at /usr/src/packages/BUILD/dlls/ntdll/signal_i386.c:603:9

@rustbot label +A-backtrace +A-debuginfo +A-panic +A-runtime +E-needs-investigation +O-windows +O-x86_32 +T-compiler

@purplesyringa purplesyringa added the C-bug Category: This is a bug. label Jan 19, 2025
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. A-backtrace Area: Backtraces A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-panic Area: Panicking machinery A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status O-windows Operating system: Windows O-x86_32 Target: x86 processors, 32 bit (like i686-*) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 19, 2025
@purplesyringa
Copy link
Contributor Author

@rustbot label -needs-triage

@rustbot rustbot removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 19, 2025
@jyn514
Copy link
Member

jyn514 commented Jan 19, 2025

the default panic hook will give up after 100 frames for short backtraces (RUST_BACKTRACE=1), but it has no such limit for full backtraces. it seems reasonable to me to add a higher limit for that case - maybe 1000 frames? that should be enough for any reasonable program, more than that and you’re likely to exhaust the stack anyway.

@jyn514
Copy link
Member

jyn514 commented Jan 19, 2025

oh, we could also check for cyclic frames, if we end up back at the same instruction address we know dynamically that we’ll never finish printing.

@bjorn3
Copy link
Member

bjorn3 commented Jan 20, 2025

if we end up back at the same instruction address we know dynamically that we’ll never finish printing.

Rather than checking the instruction pointer, we should check the stack pointer. The instruction pointer will be the same in a recursive function, but the stack pointer should be strictly increasing as we iterate up the stack except for maybe the first frame when frame pointers are omitted.

@ChrisDenton
Copy link
Member

#135804 hopefully works around this by using bjorn3's idea.

@ChrisDenton ChrisDenton linked a pull request Jan 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backtrace Area: Backtraces A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-panic Area: Panicking machinery 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-investigation Call for partcipation: This issues needs some investigation to determine current status O-windows Operating system: Windows O-x86_32 Target: x86 processors, 32 bit (like i686-*) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants