- Create a pipe
- fork()
- Make child process execute addr2line
- In parent process, convert the addresses returned from backtrace() to hexadecimal
- Write the hex addresses to the pipe
- Read back the output from addr2line and print/log it
Since you're doing all this from a signal handler, make sure to not use functionality which is not async-signal-safe. You can see a list of async-signal-safe POSIX functions here.