Repository navigation
Panic/SIGSEGV in unwind cleanup #66781
Description
Activity
- changed the title
[-]Panic in unwind cleanup[/-][+]Panic/SIGSEGV in unwind cleanup[/+]on Nov 26, 2019 - addedA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-bugCategory: This is a bug.Category: This is a bug.T-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]
on Nov 26, 2019 @sfackler do you have a coredump of the process? Would be interesting to see what the pointer/argument values are…
Either way I think the only feasible way to investigate this issue would be for us to look into doing some syscall fault injection fuzzing kind of thing.
Unfortunately, I was not able to grab any cores :(
Yeah, if my hypothesis about mmap failures is correct, you could maybe LD_PRELOAD in a mmap that can be triggered to fail or something.
Case 1 can be caused if a foreign (C/C++) exception is caught by a
catch_panic. This is now fixed by #65646.I'm not sure about case 2, but it might be a similar issue.
Ah! That could explain it. The server does talk to RocksDB via some slightly sloppy FFI bindings that don't catch C++ exceptions, and I wouldn't be surprised if some error in rocks throws.
In your particular case I suspect it's just C++ throwing
std::bad_allocwhennewfails.I think we can close this issue unless the problem is reproduced with 1.40+ which include #65646.
Reacted by Steven Fackler
We had a Rust (1.39.0 stable on x86_64-unknown-linux-gnu) service running on a server that started to exhaust its resources - in particular,
mmapcalls were returningENOMEM. While in this state, the standard library's unwinding glue started encountering some issues:Nonevalue:That corresponds to this unwrap here: https://github.com/rust-lang/rust/blob/1.39.0/src/libpanic_unwind/gcc.rs#L91.
__rust_maybe_catch_panic:My guess is that the inability to mmap somehow put the unwinder in a bad place?