Bug 850398 - python backtrace "py-bt" gdb command doesn't work on x86_64
python backtrace "py-bt" gdb command doesn't work on x86_64
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python (Show other bugs)
7.0
x86_64 Unspecified
medium Severity low
: rc
: ---
Assigned To: Python Maintainers
Branislav Náter
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-21 10:22 EDT by Branislav Náter
Modified: 2014-06-13 08:43 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 08:43:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
bnater: needinfo-


Attachments (Terms of Use)

  None (edit)
Description Branislav Náter 2012-08-21 10:22:38 EDT
Description of problem:
Looks like there is regression in printing feature on x86_64 architecture. Feature does work correctly on ppc64 and s390x.

Version-Release number of selected component (if applicable):
python-2.7.3-7.el7.x86_64
python-debuginfo-2.7.3-7.el7.x86_64
gdb-7.4.50.20120120-46.el7.x86_64

How reproducible:
Output from automated test:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6e84ebf in __strlen_sse42 () from /lib64/libc.so.6
#10 Frame 0x6e3180, 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 information optimized out)
#17 Frame 0x6d93a0, for file test.py, line 13, in <module> ()
    f.bar()
A debugging session is active.

	Inferior 1 [process 3947] will be killed.

Quit anyway? (y or n) [answered Y; input not from terminal]
:: [   PASS   ] :: Running gdb
:: [   PASS   ] :: File 'output' should not contain 'Error occurred in Python command'
:: [   PASS   ] :: File 'output' should contain 'file .*ctypes.*in.*string_at'
:: [   FAIL   ] :: File 'output' should contain 'file.*test.py.*in.*bar' 
:: [   PASS   ] :: File 'output' should contain 'file.*test.py.*in.*module'

=============================================================================
Additional info:
Pretty output from s390x architecture:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
PyString_FromString (str=0xdeadbeef <Address 0xdeadbeef out of bounds>) at /usr/src/debug/Python-2.7.3/Objects/stringobject.c:121
121	    size = strlen(str);
#9 Frame 0x800e4038, for file /usr/lib64/python2.7/ctypes/__init__.py, line 504, in string_at (ptr=3735928559, size=-1)
    return _string_at(ptr, size)
#13 Frame 0x800da598, for file test.py, line 4, in bar (self=<Foo(someattr=42, someotherattr={'three': [(), (None,), (None, None)], 'two': 2L, 'one': 1}) at remote 0x3fffda40048>, string_at=<function at remote 0x3fffda3fba8>)
    string_at(0xDEADBEEF) # this code will cause Python to segfault
#16 Frame 0x800d9f08, for file test.py, line 13, in <module> ()
    f.bar()
A debugging session is active.

	Inferior 1 [process 4978] will be killed.

Quit anyway? (y or n) [answered Y; input not from terminal]
:: [   PASS   ] :: Running gdb
:: [   PASS   ] :: File 'output' should not contain 'Error occurred in Python command'
:: [   PASS   ] :: File 'output' should contain 'file .*ctypes.*in.*string_at'
:: [   PASS   ] :: File 'output' should contain 'file test.py, line 4, in bar.*someattr=42'
:: [   PASS   ] :: File 'output' should contain 'file test.py, line 13, in <module>'
Comment 4 Petr Šplíchal 2013-02-22 06:15:57 EST
I guess broken functionality on x86_64 is caused by bug 556975.
However, on RHEL6 we get at least something rather than just
"frame information optimized out", here's the RHEL6 output:

Program received signal SIGSEGV, Segmentation fault.
__strlen_sse2 () at ../sysdeps/x86_64/strlen.S:32
32		movdqu	(%rdi), %xmm1
#10 file '/usr/lib64/python2.6/ctypes/__init__.py', in 'string_at'
#14 file 'test.py', in 'bar'
#17 file 'test.py', in '<module>'
A debugging session is active.

Dave, could we get the same on RHEL7 until bug 556975 is fixed?
Comment 6 Bohuslav "Slavek" Kabrda 2013-07-24 05:58:18 EDT
There is a chance that this may be fixed by fixing https://bugzilla.redhat.com/show_bug.cgi?id=835053, let's wait till that is fixed and then rerun the tests using new build.
Comment 7 Branislav Náter 2013-07-31 09:53:46 EDT
Issue si fixed in python-debug-2.7.5-1.el7

<snip>
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6d6e631 in __strlen_sse2 () from /lib64/libc.so.6
#10 Frame 0x86c2d0, 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 0x686140, for file test.py, line 5, in bar (self=<Foo(someattr=42, someotherattr={'three': [(), (None,), (None, None)], 'two': 2L, 'one': 1}) at remote 0x823600>, string_at=<function at remote 0x884450>)
    string_at(0xDEADBEEF) # this code will cause Python to segfault
#17 Frame 0x85d2b0, for file test.py, line 16, in <module> ()
    f.bar()
A debugging session is active.

	Inferior 1 [process 1476] will be killed.

Quit anyway? (y or n) [answered Y; input not from terminal]
:: [   PASS   ] :: Running gdb
:: [   PASS   ] :: File 'output' should not contain 'Error occurred in Python command'
:: [   PASS   ] :: File 'output' should contain '[fF]ile .*ctypes.*in.*string_at'
:: [   PASS   ] :: File 'output' should contain '[fF]ile.*test.py.*in.*bar'
:: [   PASS   ] :: File 'output' should contain '[fF]ile.*test.py.*in.*module'
</snip>
Comment 8 Ludek Smid 2014-06-13 08:43:36 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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