Skip to content

Developer notes

Tianhao Wang edited this page May 23, 2024 · 2 revisions

debugging host syscalls with strace

  1. launch quark container, add --pid=host to the docker command
  2. in the host (-f is to follow forks)
    sudo strace  -f -p $(pidof quark_d)
    
  3. optionally, exclude the epoll_wait syscall because it's too noisy, or filter syscalls of interests. Note that strace outputs to stderr so you may need to redirect stderr to stdout
    sudo strace  -f -p $(pidof quark_d) 2>&1 | grep -v epoll_wait
    

backtrace for qkernel

(copied from #1267)

for this, you need

  1. rustfilt to demangle the symbols, you can install it via cargo install rustfilt
  2. llvm-addr2line to map address (PC) back to ELF (and code). This comes with the llvm package and you should already have it. The name could differ, for example llvm-addr2line-14 on our ubuntu test machine. If this is not option for you, try addr2line which comes with the binutils

to do the magic, run the following command in a terminal:

llvm-addr2line -fpipe <PATH-TO-QKERNEL-BINARY> | rustfilt

then copy paste the addresses (PC) from the backtrace frames: these are printed in the log upon panics.

0x40000e75c0
0x400020350c
0x4000203f00
0x4000071730
0x4000061404
0x4000121ce8
0x40000e6d70
0x400007cd2c
0x400009f138

Then you have it!

Clone this wiki locally