Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to locate gdb frame for python bytecode interpreter

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?

like image 202
Amir Avatar asked Sep 05 '25 09:09

Amir


1 Answers

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.

like image 60
brianc Avatar answered Sep 08 '25 02:09

brianc