I am debugging a container issue where runc gets stuck. I wanted to know how to dump the stack trace of runc to understand where it is getting stuck. It seems to be possible based on this response: https://github.com/opencontainers/runc/pull/2871#issuecomment-816492231 on another runc stuck issue.
I figured out a way to do it. Run cat /proc/<runc_pid>/fd/2
to print out stderr messages of the faulting runc process when it fills up. Send a SIGQUIT kill signal to the process using kill -SIGQUIT <runc_pid>
, this will cause the go routine stack trace to dumped onto stderr which can be seen using the cat
started earlier.