I ty to get a stacktrace from the running python process, using gdb. The python is running in an virtualenv managed by pyenv, on Ubuntu 16.4.
I tried this:
sudo gdb ~/.pyenv/versions/bla/bin/python -p <PID>
Then I do not have the extensions available, so I do
symbol-file /usr/bin/python3.5-dbg
Then when I run py-list, I get the following error:
Unable to locate gdb frame for python bytecode interpreter.
Also tried:
sudo gdb /usr/bin/python3.5-dbg -p <PID>
and same error.
Any other way? Or an easier approach?
Probably your python version in the virtual env is incompatible with the python dbg package, which is compatible with the python at /usr/bin/. I've solved this problem by copying the python at /usr/bin to the virtual env and re-running. Even if both pythons are the same version the build date seems to make a big difference for gdb debugging.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With