You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cargo-install print-stacktrace
Installing ...
$ print-stacktrace rust-analyzer
thread #10, name = 'rust-analyzer'
frame #0: 0x00007f7133cd7bb9 libc.so.6`sysmalloc(nb=336, av=0x00007f7108000020) at malloc.c:2739
frame #1: 0x00007f7133cd8ff0 libc.so.6`_int_malloc(av=0x00007f7108000020, bytes=321) at malloc.c:4125
frame #2: 0x00007f7133cd98f5 libc.so.6`_int_realloc(av=0x00007f7108000020, oldp=0x00007f70afffff30, oldsize=176, nb=336) at malloc.c:4570
frame #3: 0x00007f7133cdcf9b libc.so.6`__GI___libc_realloc(oldmem=&0x7f70afffff40, bytes=320) at malloc.c:3230
frame #4: 0x00005571f6b8846b rust_analyzer`_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..SpecExtend$LT$T$C$I$GT$$GT$::from_iter::hdc9ae08fd4d2dcd5 [inlined] alloc::alloc::realloc::h7df9eca016b70494 at alloc.rs:128
...
Long version:
For my personal use, I reach for debuggers mostly to get stactraces on deadlocks/livelocks. Every time I need to google how to gdb and recollect that bt thread all incantation. Moreover, when I debug a hang on someone-else's computer, I need to teach them how to work with gdb. My life would be much easier if I can ask them to just cargo install print-stacktrace .
This utility should dump a stack of a running process using either process name (default) or PID (with -p argument). Defaulting to name makes sense, as figuring out a PID is often a stumbling block. If there's more than one process with a matching name, I think the tool should print:
Found 2 processes with a name `foo`:
Pid: Process:
1234 '/usr/bin/foo --eggs'
9292 '/home/alice/bin/foo --spam'
Use the following command to disambiguate:
print-stacktrace -p Pid
It seems like implementing this should be possible in the early stages of headcrab (I've said it already, and I say it again: what a delightful name!), and it'll put some part of the infra into production usage.
The text was updated successfully, but these errors were encountered:
matklad
changed the title
Feature request: stand-alone library to dump a running process' stacktrace
Feature request: stand-alone binary to dump a running process' stacktrace
Nov 16, 2020
Headcrab doesn't have support for DWARF unwinding yet (#60). It shouldn't be too implement this tool for the existing frame pointer unwinder though. I don't think I will be able to implement this myself very soon unfortunately.
Sort version of an ask:
Long version:
For my personal use, I reach for debuggers mostly to get stactraces on deadlocks/livelocks. Every time I need to google how to gdb and recollect that
bt thread all
incantation. Moreover, when I debug a hang on someone-else's computer, I need to teach them how to work with gdb. My life would be much easier if I can ask them to justcargo install print-stacktrace
.This utility should dump a stack of a running process using either process name (default) or PID (with -p argument). Defaulting to name makes sense, as figuring out a PID is often a stumbling block. If there's more than one process with a matching name, I think the tool should print:
It seems like implementing this should be possible in the early stages of headcrab (I've said it already, and I say it again: what a delightful name!), and it'll put some part of the infra into production usage.
The text was updated successfully, but these errors were encountered: