Gdb inside container gets terminated with 137

9/11/2020

When I run gdb on my binary inside kubernetes pod in container it starts loading symbol after that it suddenly gets terminated with SIGTERM and exit code 137. I checked for describe pod it shows reason Error. I have added ptrace capabilities in yaml. Can someone help me with this.

-- Pranay Nagpure
c++
gdb
kubernetes
sigterm

1 Answer

9/11/2020

Exit code 137 means that the process was killed by signal 9 (137=128+9). Most likely reason is that container was running out of memory and gdb was killed by OOM Killer. Check dmesg output for any messages from OOM Killer.

-- ks1322
Source: StackOverflow