Skip to content

<no info> frames on Windows when using unresolved backtraces since 0.3.16 #197

Closed
@udoprog

Description

@udoprog

failure::Error uses unresolved backtraces (resolved lazily) which seems to be broken in recent versions of the backtrace crate.

The following program on Windows msvc using backtrace versions 0.3.16 - 0.3.28 (rustc 1.37.0-nightly (7840a0b75 2019-05-31)):

fn main() {
    let mut bt = backtrace::Backtrace::new_unresolved();
    bt.resolve();
    println!("{:?}", bt);
}

Produces the following backtrace:

stack backtrace:
   0: <no info> (0x7ff6462820e2)
   1: <no info> (0x7ff6462820e2)
   2: <no info> (0x7ff646282010)
   3: <no info> (0x7ff646274e68)
   4: <no info> (0x7ff646274dc9)
   5: <no info> (0x7ff646271238)
   6: <no info> (0x7ff646271190)
   7: <no info> (0x7ff6462b4137)
   8: <no info> (0x7ff6462b4137)
   9: <no info> (0x7ff6462b7072)
  10: <no info> (0x7ff6462b49e2)
  11: <no info> (0x7ff6462b49e2)
  12: <no info> (0x7ff6462b49e2)
  13: <no info> (0x7ff64627116b)
  14: <no info> (0x7ff646271320)
  15: <no info> (0x7ff6462bf340)
  16: <no info> (0x7ff6462bf340)
  17: BaseThreadInitThunk (0x7ff8c1f97974)
  18: RtlUserThreadStart (0x7ff8c4c1a271)

0.3.15 produces the correct backtrace, so it seems the regression was introduced in 0.3.16:

stack backtrace:
   0: backtrace_not_working::main (0x7ff637ed1178)
             at D:\Work\Repo\backtrace-not-working\src\main.rs:3
   1: std::rt::lang_start::{{closure}}<()> (0x7ff637ed10c0)
             at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e\src\libstd\rt.rs:64
   2: std::panicking::try::do_call<closure,i32> (0x7ff637f0feb7)
             at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e\/src\libstd\panicking.rs:293
   3: panic_unwind::__rust_maybe_catch_panic (0x7ff637f12df2)
             at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e\/src\libpanic_unwind\lib.rs:87
   4: std::rt::lang_start_internal (0x7ff637f10762)
             at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e\/src\libstd\rt.rs:48
   5: std::rt::lang_start<()> (0x7ff637ed109b)
             at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e\src\libstd\rt.rs:64
   6: main (0x7ff637ed1260)
   7: __scrt_common_main_seh (0x7ff637f1b18c)
             at d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288   8: BaseThreadInitThunk (0x7ff8c1f97974)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions