Message217909
Victor, where can you reproduce it (OS, python version, what C lib)?
I don't receive segfault, only sigpipe (see msg217818 ). Here's gdb backtrace after the signal:
Program received signal SIGPIPE, Broken pipe.
0x00007ffff71e1040 in __write_nocancel () at ../sysdeps/unix/syscall-template.S:82
82 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) backtrace
#0 0x00007ffff71e1040 in __write_nocancel () at ../sysdeps/unix/syscall-template.S:82
#1 0x00007ffff7173883 in _IO_new_file_write (f=0x7e1f10, data=0x7ffff66cb034,
n=1097728) at fileops.c:1289
#2 0x00007ffff717374a in new_do_write (fp=0x7e1f10,
data=0x7ffff66cb034 "0123456789\n...01"...,
to_do=1097728) at fileops.c:543
#3 0x00007ffff71741fe in _IO_new_file_xsputn (n=1100000, data=<optimized out>,
f=0x7e1f10) at fileops.c:1383
#4 _IO_new_file_xsputn (f=0x7e1f10, data=<optimized out>, n=1100000)
at fileops.c:1305
#5 0x00007ffff7169cdd in _IO_fwrite (buf=<optimized out>, size=1, count=1100000,
fp=0x7e1f10) at iofwrite.c:45
#6 0x000000000042c23c in file_write (f=0x7ffff7f16540, args=<optimized out>)
at Objects/fileobject.c:1851
Note: the line is 1851, not 1852 (as in the latest 2.7 version [1]) as in your traceback.
And the calls inside _IO_new_file_xsputn() are also different.
[1]: http://hg.python.org/cpython/file/b768d41dec0a/Objects/fileobject.c#l1852
python2.7.6 is installed using `pythonz install 2.7.6` command.
Just to make sure that python2.7.6 *can* segfault:
$ python2.7.6 -c'import ctypes; ctypes.memset(0,0,1)'
Segmentation fault (core dumped)
core file is not written on my system:
$ cat /proc/sys/kernel/core_pattern
|/usr/share/apport/apport %p %s %c
But I can see in the log when a process segfaults e.g.,
the segfault due to memset is logged:
$ tail -F /var/log/apport.log
ERROR: apport (pid 8501) ... executable: ~/.pythonz/pythons/CPython-2.7.6/bin/python2.7 \
(command line "python2.7.6 -cimport\ ctypes;\ ctypes.memset(0,0,1)")
To find out where `fwrite` come from, I've done:
$ nm $(which python2.7.6) | grep fwrite
U fwrite@@GLIBC_2.2.5
$ cat $(gcc -print-file-name=libc.so)
/* GNU ld script
... */
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib/x86_64-linux-gnu/libc.so.6 ... )
$ ldd $(which python2.7.6)
...
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
...
$ /lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu EGLIBC 2.15-0ubuntu10.5) stable release version 2.15, by Roland McGrath et al.
Copyright (C) 2012 Free Software Foundation, Inc.
...
Compiled by GNU CC version 4.6.3.
Compiled on a Linux 3.2.50 system on 2013-09-30.
...
/usr/bin/python behaves similar -- it just has version that is not mentioned by the OP. |
|
Date |
User |
Action |
Args |
2014-05-05 07:13:36 | akira | set | recipients:
+ akira, terry.reedy, vstinner, neologix, hanno |
2014-05-05 07:13:36 | akira | set | messageid: <1399274016.54.0.0889183899235.issue20866@psf.upfronthosting.co.za> |
2014-05-05 07:13:36 | akira | link | issue20866 messages |
2014-05-05 07:13:34 | akira | create | |
|