gdb unable to read python frame information

D

dieter

Wesley said:
If you don't read the loop from the top, and don't tell me exactly what you want by just keep saying context, please ingore this post.

You are doing things only a few people do: trying to debug
a Python process on C level -- and you observe really strange things.
It is very difficult to guess from the distance what goes wrong.

Apparently, your gdb sees a very strange state of the debugged
process. But why?

Missing symbols was the first guess (the
gdb output you have provided does not suggest this - but
I have not seen the "reading symbols from "python" ..."; thus,
there may still be a problem with this).

A runaway process is another guess.

Some gdb problem another one.


I would approach the situation by simplifying the setup.
Instead of attaching a running Python process, I would
use "gdb python"; then "run"; then "CTRL-C" and there look
what "bt" gives you (this should demonstrate whether your
"gdb" is set up correctly and can debug Python on C level).
Then you write an infinitely running function in Python,
run it and again interrupt with "gdb" to see whether the "py-*"
commands are working. If this all work, you come again
to your actual task -- understanding what your python process
is doing.
 
W

Wesley

[root@localhost ~]# gdb python
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python...Reading symbols from /usr/lib/debug/usr/bin/python2.6.debug...done.
done.
(gdb) run
Starting program: /usr/bin/python
warning: the debug information found in "/usr/lib/debug//usr/lib64/libpython2.6.so.1.0.debug" does not match "/usr/lib64/libpython2.6.so.1.0" (CRC mismatch).

warning: the debug information found in "/usr/lib/debug/usr/lib64/libpython2.6.so.1.0.debug" does not match "/usr/lib64/libpython2.6.so.1.0" (CRC mismatch).

[Thread debugging using libthread_db enabled]
Python 2.6.6 (r266:84292, Nov 22 2013, 12:16:22)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Program received signal SIGTSTP, Stopped (user).
0x00000034214e15c3 in __select_nocancel () at ../sysdeps/unix/syscall-template.S:82
82 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
Missing separate debuginfos, use: debuginfo-install python-2.6.6-51.el6.x86_64

Seems no debuginfo installed, but actually I have installed before, here ischeck:

root@localhost ~]# debuginfo-install python-2.6.6-51.el6.x86_64
Loaded plugins: auto-update-debuginfo, fastestmirror, refresh-packagekit
enabling epel-debuginfo
Loading mirror speeds from cached hostfile
epel/metalink | 4.7 kB 00:00
epel-debuginfo/metalink | 4.9 kB 00:00
* base: mirrors.yun-idc.com
* epel: mirrors.hustunique.com
* epel-debuginfo: mirrors.hustunique.com
* extras: mirrors.yun-idc.com
* rpmforge: mirror.hmc.edu
* updates: mirrors.stuhome.net
adobe-linux-x86_64 | 951 B 00:00
base | 3.7 kB 00:00
debug | 2.5 kB 00:00
debug/primary_db | 966 kB 00:06
epel | 4.2 kB 00:00
epel/primary_db | 6.0 MB 01:19
epel-debuginfo | 3.0 kB 00:00
epel-debuginfo/primary_db | 587 kB 00:07
extras | 3.4 kB 00:00
google64 | 951 B 00:00
rpmforge | 1.9 kB 00:00
updates | 3.4 kB 00:00
Checking for new repos for mirrors
Package matching python-debuginfo-2.6.6-51.el6.x86_64 already installed. Checking for update.
Package glibc-debuginfo-2.12-1.132.el6.x86_64 already installed and latest version
Package glibc-debuginfo-2.12-1.132.el6.x86_64 already installed and latest version
Package glibc-debuginfo-2.12-1.132.el6.x86_64 already installed and latest version
Package glibc-debuginfo-2.12-1.132.el6.x86_64 already installed and latest version
Package glibc-debuginfo-2.12-1.132.el6.x86_64 already installed and latest version
Package matching python-debuginfo-2.6.6-51.el6.x86_64 already installed. Checking for update.
Package glibc-debuginfo-2.12-1.132.el6.x86_64 already installed and latest version
No debuginfo packages available to install

在 2014å¹´3月10日星期一UTC+8下åˆ3æ—¶28分30秒,dieter写é“:
 
W

Wesley

Now, I fixed the problem...

Instead of python2.6.6, for python 2.7 it's OK..

Why? gdb does not support python 2.6.6?

Is it related to python-gdb.py? I googled a lot, seems only has python2.7-gdb.py, no python2.6-gdb.py.


在 2014å¹´3月10日星期一UTC+8下åˆ3æ—¶28分30秒,dieter写é“:
 
D

dieter

Wesley said:
...
[root@localhost ~]# gdb python
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1)
This GDB was configured as "x86_64-redhat-linux-gnu".
Reading symbols from /usr/bin/python...Reading symbols from /usr/lib/debug/usr/bin/python2.6.debug...done.
done.
(gdb) run
Starting program: /usr/bin/python
warning: the debug information found in "/usr/lib/debug//usr/lib64/libpython2.6.so.1.0.debug" does not match "/usr/lib64/libpython2.6.so.1.0" (CRC mismatch).

warning: the debug information found in "/usr/lib/debug/usr/lib64/libpython2.6.so.1.0.debug" does not match "/usr/lib64/libpython2.6.so.1.0" (CRC mismatch).

This indicates that there is a problem between the executed code
and the debug information. Apparently, they do not match.

An installation problem might be the cause - maybe, a packaging problem.


Have you not told us that you have build your own Python from
source? Usually, such a Python would not reside under "/usr/bin"
but more likely under "/usr/local/bin" (of course, doing special
things, you can force a build from source to install unter "/usr/bin",
but this usually is not advicable -- it is potentially interfering with
system installed components).

If you have generated your own Python, you must ensure that it
is consistently used (for all the cases you are concerned by).
 
D

dieter

Wesley said:
Now, I fixed the problem...

Instead of python2.6.6, for python 2.7 it's OK..

Why? gdb does not support python 2.6.6?

gdb supports python 2.6.6 as well (it is a C level debugger with
very few dependencies on Python).

Your reports seem to suggest that your Python 2.6.6 installation
is somehow screwed up - for whatever reason.

Is it related to python-gdb.py?

Very unlikely.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,077
Messages
2,570,567
Members
47,203
Latest member
EmmaSwank1

Latest Threads

Top