Bug 1008154 - gdb py-bt command raises an exception while processing statements form eval , causes missing trace info
Summary: gdb py-bt command raises an exception while processing statements form eval ,...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Bohuslav "Slavek" Kabrda
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-15 09:47 UTC by Attila Fazekas
Modified: 2013-10-14 17:09 UTC (History)
8 users (show)

Fixed In Version: python-2.7.5-8.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-12 04:25:27 UTC
Type: Bug


Attachments (Terms of Use)
die2.py (115 bytes, text/x-python-script)
2013-09-15 09:47 UTC, Attila Fazekas
no flags Details
simple-py-gdb-eval.patch (635 bytes, patch)
2013-09-15 10:05 UTC, Attila Fazekas
no flags Details | Diff
simple-py-gdb-eval-trace.patch (635 bytes, patch)
2013-09-15 10:07 UTC, Attila Fazekas
no flags Details | Diff

Description Attila Fazekas 2013-09-15 09:47:24 UTC
Created attachment 797859 [details]
die2.py

Description of problem:

/usr/lib/debug/usr/lib64/libpython2.7.so.1.0.debug-gdb.py raises an exception while processing an eval block.

Version-Release number of selected component (if applicable):
python-debuginfo-2.7.3-13.fc18.x86_64
python-debuginfo-2.7.5-4.fc19.x86_64

How reproducible:
always

Steps to Reproduce:
1. Create python program with eval
2. Use py-bt in gdb


Actual results:
Stack trace printing stops after trying to print a frame originated from an eval block.

Python Exception <type 'exceptions.IOError'> (2, 'No such file or directory', '<string>'): 
Error occurred in Python command: (2, 'No such file or directory', '<string>')

Expected results:

a, The frame info printing continues even if the stack trace contains a statement from an eval block

b, Tries to print the related statement from the eval string.

Additional info:

$ gdb --args python die2.py
GNU gdb (GDB) Fedora (7.6-34.fc19)
Copyright (C) 2013 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/python2.7...Reading symbols from /usr/lib/debug/usr/bin/python2.7.debug...done.
done.
(gdb) run
Starting program: /usr/bin/python2.7 die2.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
__strlen_sse2_pminub () at ../sysdeps/x86_64/multiarch/strlen-sse2-pminub.S:38
38              movdqu  (%rdi), %xmm1
(gdb) py-bt
#10 Frame 0x6e1ab0, for file /usr/lib64/python2.7/ctypes/__init__.py, line 504, in string_at (ptr=3735928559, size=-1)
    return _string_at(ptr, size)
#14 Frame 0x6f6680, for file die2.py, line 6, in die_func ()
    string_at(0xDEADBEEF)
#17 Frame 0x6f5220, for file <string>, line 1, in <module> ()
Python Exception <type 'exceptions.IOError'> [Errno 2] No such file or directory: '<string>': 
Error occurred in Python command: [Errno 2] No such file or directory: '<string>'

Comment 1 Attila Fazekas 2013-09-15 10:05:28 UTC
Created attachment 797860 [details]
simple-py-gdb-eval.patch

A very simple patch attached, which solves the issues most annoying aspect: the partial stack-trace.

Comment 2 Attila Fazekas 2013-09-15 10:07:59 UTC
Created attachment 797861 [details]
simple-py-gdb-eval-trace.patch

Comment 3 Dave Malcolm 2013-10-02 14:57:15 UTC
Patch looks reasonable to me

Comment 4 Bohuslav "Slavek" Kabrda 2013-10-08 12:12:24 UTC
Thanks for the patch, I'll accept it and build. (Note: Python 3 version is not affected by this, as there is a try/except block that opens the file. But this may be a way to display nicer information, so I'll try to submit to upstream anyway)

Comment 5 Fedora Update System 2013-10-08 14:05:18 UTC
python-2.7.5-8.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/python-2.7.5-8.fc20

Comment 6 Fedora Update System 2013-10-08 14:05:38 UTC
python-2.7.5-8.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-2.7.5-8.fc19

Comment 7 Fedora Update System 2013-10-09 14:18:12 UTC
Package python-2.7.5-8.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-2.7.5-8.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-18526/python-2.7.5-8.fc20
then log in and leave karma (feedback).

Comment 8 Scott Poore 2013-10-10 22:16:11 UTC
I don't see this failure in f20 now.

python-2.7.5-8.fc20.x86_64

[root@f20-1 ~]# gdb --args python die2.py
GNU gdb (GDB) Fedora 7.6.50.20130731-12.fc20
Copyright (C) 2013 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".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
..
Reading symbols from /usr/bin/python2.7...Reading symbols from /usr/lib/debug/usr/bin/python2.7.debug...done.
done.
(gdb) run
Starting program: /usr/bin/python2.7 die2.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6db36ba in strlen () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.18-11.fc20.x86_64 libffi-3.0.13-5.fc20.x86_64
(gdb) py-bt
#10 Frame 0x6cd9b0, for file /usr/lib64/python2.7/ctypes/__init__.py, line 504, in string_at (ptr=3735928559, size=-1)
    return _string_at(ptr, size)
#14 Frame 0x6f57f0, for file die2.py, line 6, in die_func ()
    string_at(0xDEADBEEF)
#17 Frame 0x6f3960, for file <string>, line 1, in <module> ()
    (in an eval block)
#24 Frame 0x642680, for file die2.py, line 8, in <module> ()
    eval("die_func()")

Comment 9 Fedora Update System 2013-10-12 04:25:27 UTC
python-2.7.5-8.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2013-10-14 06:57:40 UTC
python-2.7.5-8.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2013-10-14 17:09:54 UTC
python-2.7.5-8.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.