How to diagnose a `stack overflow` issue's cause?

I'll just leave a workaround here for fledglings like me.
I used lldb, gdb should work too, I think.

$ lldb target/debug/app_bin
#enter lldb cmd to start the process
(lldb) process launch

Stack over flow will force the process to exit

Process 2164815 launched: '/path/to/project/target/debug/app_bin' (x86_64)
Process 2164815 stopped
* thread #1, name = 'app_bin', stop reason = signal SIGSEGV: invalid address (fault address: 0x7fffff7fe2f8)
    frame #0: 0x000055566c204a app_bin`__rust_probestack + 23
app_bin`__rust_probestack:
->  0x5555566c204a <+23>: testq  %rsp, 0x8(%rsp)

To see the call stack

(lldb) thread backtrace
13 Likes