New submission from Yu Yuwei <acev...@gmail.com>:

I'm on Gentoo Linux with glibc-2.9_20081201-r2, python-2.6.2,
e2fsprogs-libs-1.41.3-r1
When Emesene send offline message to another msn user, it call uuid4()
in uuid module in python, which call get_random_fd()
in gen_uuid.c(e2fsprogs-libs).
After this, the program got signal SIGSEGV.

When I used gdb attach to the python process, I got these:
##########################
(gdb) c
Continuing.
[New Thread 0xb1c09b90 (LWP 6445)]
[Thread 0xb1c09b90 (LWP 6445) exited]
[New Thread 0xb1c09b90 (LWP 6446)]
[New Thread 0xb118cb90 (LWP 6447)]
[New Thread 0xb098bb90 (LWP 6448)]
[New Thread 0xb018ab90 (LWP 6449)]
[Thread 0xb018ab90 (LWP 6449) exited]
[Thread 0xb098bb90 (LWP 6448) exited]
[Thread 0xb1c09b90 (LWP 6446) exited]
[Thread 0xb118cb90 (LWP 6447) exited]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7d126c0 (LWP 6423)]
0xb6f0745e in get_random_fd () at gen_uuid.c:153
153 gen_uuid.c: No such file or directory.
in gen_uuid.c
################

(gdb) bt
#0 0xb6f0745e in get_random_fd () at gen_uuid.c:153
#1 0xb6f07509 in get_random_bytes (buf=0xbfe3fc70, nbytes=16)
at gen_uuid.c:172
#2 0xb6f086ee in uuid__generate_random (out=0x9f62fc8 "", num=0xbfe3fcb4)
at gen_uuid.c:591
#3 0xb6f08780 in uuid_generate_random (out=0x9f62fc8 "") at
gen_uuid.c:607
#4 0xb666e3db in ffi_call_SYSV ()
from /usr/lib/python2.6/lib-dynload/_ctypes.so
#5 0xb666e159 in ffi_call () from
/usr/lib/python2.6/lib-dynload/_ctypes.so
#6 0xb6668ebb in _CallProc () from
/usr/lib/python2.6/lib-dynload/_ctypes.so
#7 0xb66620eb in ?? () from /usr/lib/python2.6/lib-dynload/_ctypes.so
#8 0xb6f08755 in uuid__generate_random (out=0x9f4950c "\005",
num=0xa7fdb2c)
at gen_uuid.c:600
#9 0xb7ed0dba in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#10 0xb7f679b0 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#11 0xb7f6ae49 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#12 0xb7f6ae49 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#13 0xb7f6b72e in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#14 0xb7efb774 in ?? () from /usr/lib/libpython2.6.so.1.0
#15 0x0a23ce30 in ?? ()
#16 0x0a14d02c in ?? ()
#17 0x00000000 in ?? ()
###########

the line 153 in get_uuid.c is
" jrand_seed[0] = getpid() ^ (tv.tv_sec & 0xFFFF);"
so in gdb I type:
(gdb) p jrand_seed[0]
Cannot access memory at address 0x30
#######

So this cause the segfault. But I don't know why.
May be related to the THREAD_LOCAL keywords :

#if defined(__linux__) && defined(__NR_gettid) && defined(HAVE_JRAND48)
#define DO_JRAND_MIX
THREAD_LOCAL unsigned short jrand_seed[3];
#endif

I try emesene with another gentoo box with same glibc and same
e2fsprogs-libs, but with python-2.5, everything is fine.

So this seems a bug in python-2.6.

----------
messages: 88061
nosy: acevery
severity: normal
status: open
title: uuid.uuid4 cause segfault in emesene
type: crash
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6059>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to