classification
Title: Test fail for sha512 -
Type: crash Stage:
Components: Extension Modules Versions: Python 2.6
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: frohman, gregory.p.smith
Priority: normal Keywords:

Created on 2010-03-05 16:07 by frohman, last changed 2010-12-20 01:37 by frohman. This issue is now closed.

Messages (4)
msg100488 - (view) Author: Chris Lieb (frohman) Date: 2010-03-05 16:07
I am building Python 2.6.4 with GCC 4.2.1 (SUSE Linux, kernel  2.6.22.19-0.4-default) on a shared server and am encountering test
failures in test_hashlib.py and test_hmac.py, specifically concerning
sha512.  I recompiled Python with --with-pydebug and CLFAGS=CPPFLAGS="-
g" and ran the tests in GDB and got the following results:

---------------------------------------------------------------------

GNU gdb 6.6.50.20070726-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "x86_64-suse-linux"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) run test_hashlib.py
Starting program: /export/users1/chris.lieb/packages/python/bin/
python2.6 test_hashlib.py
test_case_md5_0 (__main__.HashLibTestCase) ... ok
test_case_md5_1 (__main__.HashLibTestCase) ... ok
test_case_md5_2 (__main__.HashLibTestCase) ... ok
test_case_md5_huge (__main__.HashLibTestCase) ... ok
test_case_md5_uintmax (__main__.HashLibTestCase) ... ok
test_case_sha1_0 (__main__.HashLibTestCase) ... ok
test_case_sha1_1 (__main__.HashLibTestCase) ... ok
test_case_sha1_2 (__main__.HashLibTestCase) ... ok
test_case_sha1_3 (__main__.HashLibTestCase) ... ok
test_case_sha224_0 (__main__.HashLibTestCase) ... ok
test_case_sha224_1 (__main__.HashLibTestCase) ... ok
test_case_sha224_2 (__main__.HashLibTestCase) ... ok
test_case_sha224_3 (__main__.HashLibTestCase) ... ok
test_case_sha256_0 (__main__.HashLibTestCase) ... ok
test_case_sha256_1 (__main__.HashLibTestCase) ... ok
test_case_sha256_2 (__main__.HashLibTestCase) ... ok
test_case_sha256_3 (__main__.HashLibTestCase) ... ok
test_case_sha384_0 (__main__.HashLibTestCase) ... ok
test_case_sha384_1 (__main__.HashLibTestCase) ... ok
test_case_sha384_2 (__main__.HashLibTestCase) ... ok
test_case_sha384_3 (__main__.HashLibTestCase) ... ok
test_case_sha512_0 (__main__.HashLibTestCase) ... FAIL
test_case_sha512_1 (__main__.HashLibTestCase) ... FAIL
test_case_sha512_2 (__main__.HashLibTestCase) ... FAIL
test_case_sha512_3 (__main__.HashLibTestCase) ... FAIL
test_hexdigest (__main__.HashLibTestCase) ...
Program received signal SIGSEGV, Segmentation fault.
Cannot remove breakpoints because program is no longer writable.
It might be running in another process.
Further execution is probably impossible.
0x00002ba86ffbb463 in ?? ()
(gdb) bt
#0  0x00002ba86ffbb463 in ?? ()
#1  0x000000000046993d in PyString_FromStringAndSize (
    str=0x7fff71c67800 " \203 5~︽ T(P m\200\a \005\vW
\025 \203 ! l G <]
\205                                                    5
\203\030 \207~ /c 1 GAz\201 82z ' > x q \177",
size=1054484473)
    at Objects/stringobject.c:90
#2  0x00002ba87030d59a in ?? ()
#3  0x0000000000000000 in ?? ()

---------------------------------------------------------------------

GNU gdb 6.6.50.20070726-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "x86_64-suse-linux"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) run test_hmac.py
Starting program: /export/users1/chris.lieb/packages/python/bin/
python2.6 test_hmac.py
test_legacy_block_size_warnings (__main__.TestVectorsTestCase) ... ok
test_md5_vectors (__main__.TestVectorsTestCase) ... ok
test_sha224_rfc4231 (__main__.TestVectorsTestCase) ... ok
test_sha256_rfc4231 (__main__.TestVectorsTestCase) ... ok
test_sha384_rfc4231 (__main__.TestVectorsTestCase) ... ok
test_sha512_rfc4231 (__main__.TestVectorsTestCase) ...
Program received signal SIGSEGV, Segmentation fault.
Cannot remove breakpoints because program is no longer writable.
It might be running in another process.
Further execution is probably impossible.
0x00002b483844e4c7 in ?? ()
(gdb) bt
#0  0x00002b483844e4c7 in ?? ()
#1  0x000000000046993d in PyString_FromStringAndSize (
    str=0x7ffff84f6730 "\026C3D \235D\t \025 [ G
\032bGץ ~ \235\t\233aP",
    size=4108309188) at Objects/stringobject.c:90
#2  0x00002b48387e159a in ?? ()
#3  0x0000000000000000 in ?? ()

--------------------------------------------------------------------

In the case of test_hashlib.py, it segfaulted on the first sha512 test
when I didn't have the debugging options enabled.  Only after enabling
debugging did I get FAIL's for the sha512 tests.

Does anyone know what is causing these failures? 

---------------------------------------------------------------------

CPUINFO

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 5
model name      : AMD Opteron(tm) Processor 246
stepping        : 8
cpu MHz         : 1992.106
cache size      : 1024 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips        : 3988.23
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts ttp

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 5
model name      : AMD Opteron(tm) Processor 246
stepping        : 8
cpu MHz         : 1992.106
cache size      : 1024 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips        : 3990.71
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts ttp
msg101005 - (view) Author: Chris Lieb (frohman) Date: 2010-03-13 15:51
Just for reference, I tried applying all of the patches in the SuSE 11.2 source RPM python-2.6.4.92-3.1.src.rpm from http://software.opensuse.org/search?q=python and rebuilding and retesting, but got the same results as using the vanilla Python 2.6.4 sources.
msg124365 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2010-12-19 22:02
In your back traces notice that the size= argument is clearly nonsensical.

Regardless, i can't reproduce this on any of my systems (I don't have a suse system of any sort).  If that is the only place you are seeing this I strongly suspect you've got something going on there.

Without some way to reproduce this or more detailed debugging info (point to the line of python that dies and single step into the C code in gdb from there printing out relevant state along teh way to see what happens) there is nothing I can do.
msg124380 - (view) Author: Chris Lieb (frohman) Date: 2010-12-20 01:37
I don't have any way to test this anymore since they removed pretty much the entire toolchain on that server and I really don't feel like trying to get an entire toolchain built and installed just to test this.
History
Date User Action Args
2010-12-20 01:37:47frohmansetmessages: + msg124380
2010-12-19 22:02:47gregory.p.smithsetstatus: open -> closed

messages: + msg124365
resolution: works for me
title: Test fail for sha512 -> Test fail for sha512 -
2010-03-13 15:51:22frohmansetmessages: + msg101005
2010-03-06 03:35:45gregory.p.smithsetassignee: gregory.p.smith
nosy: + gregory.p.smith, - gps
2010-03-06 02:59:36pitrousetnosy: + gps
type: crash
components: + Extension Modules, - Tests
2010-03-05 16:07:32frohmancreate