Bug#651725: python-gobject: Segfault with multiprocessing and subprocess

Teddy Hogeborn teddy at recompile.se
Sun Dec 11 17:52:26 UTC 2011


Package: python-gobject
Version: 3.0.2-4
Severity: normal
Tags: upstream

I can get an intermittent segfault when running, then interrupting
with Ctrl-C, the attached program.  The program uses the gobject main
loop as the only non-built-in Python module, so I report it here,
since I can't reproduce the problem without using the gobject main
loop.

The segfault is a bit tricky to reproduce, I have to be pretty fast
when pressing Ctrl-C after starting the program, and even then it
doesn't always happen.  But it is fairly repeatable with some
perseverance.

The attached program is a pared-down version of a much much larger
program which exibited the same behavior.

I also attach a backtrace obtained when running Python 2.7 in gdb.

The problem happens both with and without the "from __future__"
imports, and in all of python2.6, python2.7, and python3.2.

/Teddy Hogeborn


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'oldstable'), (50, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-gobject depends on:
ii  python-gi         3.0.2-4
ii  python-gobject-2  2.28.6-8

python-gobject recommends no packages.

python-gobject suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: segfaultexample.py
Type: text/x-java
Size: 612 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20111211/026c1cb6/attachment.java>
-------------- next part --------------
$ gdb python
GNU gdb (GDB) 7.3-debian
Copyright (C) 2011 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-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python...Reading symbols from /usr/lib/debug/usr/b
in/python2.7...done.
done. 
(gdb) handle SIGINT nostop print pass
SIGINT is used by the debugger.
Are you sure you want to change it? (y or n) y

Signal        Stop      Print   Pass to program Description
SIGINT        No        Yes     Yes             Interrupt
(gdb) run ./segfaultexample.py
Starting program: /usr/bin/python ./segfaultexample.py
[Thread debugging using libthread_db enabled]
[New Thread 0x7ffff4fda700 (LWP 7966)]
^C
Program received signal SIGINT, Interrupt.
Traceback (most recent call last):
  File "./segfaultexample.py", line 27, in <module>

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff4fda700 (LWP 7966)]
0x00000000004267b4 in PyObject_Call (func=<optimized out>, arg=
    ('Failed to read from child watch wake up pipe: Interrupted system call',), kw=0x0) at ../Objects/abstract.c:2527
2527    ../Objects/abstract.c: No such file or directory.
        in ../Objects/abstract.c
(gdb) bt
#0  0x00000000004267b4 in PyObject_Call (func=<optimized out>, arg=
    ('Failed to read from child watch wake up pipe: Interrupted system call',), 
#1  0x0000000000426877 in call_function_tail (callable=
    <built-in method match of _sre.SRE_Pattern object at remote 0x7ffff7e2a108>, args=
    ('Failed to read from child watch wake up pipe: Interrupted system call',))
    at ../Objects/abstract.c:2561
#2  0x00000000004296f8 in PyObject_CallMethod (o=<optimized out>, name=
    0x5ffba5 "match", format=0x554ac3 "O") at ../Objects/abstract.c:2638
#3  0x000000000049e789 in check_matched (obj=<optimized out>, 
    arg=<optimized out>) at ../Python/_warnings.c:25
#4  0x000000000049f09e in check_matched (arg=<optimized out>, 
    obj=<optimized out>) at ../Python/_warnings.c:23
#5  get_filter (item=<synthetic pointer>, module='__main__', lineno=27, text=
    'Failed to read from child watch wake up pipe: Interrupted system call', 
    category=<type at remote 0xa3a670>) at ../Python/_warnings.c:145
#6  warn_explicit (category=<type at remote 0xa3a670>, message=
    <Warning at remote 0x7ffff50e1a00>, filename='./segfaultexample.py', 
    lineno=27, module='__main__', registry={}, sourceline=0x0)
    at ../Python/_warnings.c:349
#7  0x000000000049f605 in do_warn (message=
    'Failed to read from child watch wake up pipe: Interrupted system call', 
    category=<type at remote 0xa3a670>, stack_level=<optimized out>)
    at ../Python/_warnings.c:597
#8  0x000000000049f99d in PyErr_WarnEx (category=<type at remote 0xa3a670>, 
    text=<optimized out>, stack_level=1) at ../Python/_warnings.c:720
#9  0x00007ffff5127b84 in _log_func (log_domain=<optimized out>, 
    log_level=G_LOG_LEVEL_WARNING, message=
    0xa7ebc0 "Failed to read from child watch wake up pipe: Interrupted system call", user_data=0xa3a670)
    at /tmp/buildd/pygobject-2-2.28.6/gobject/gobjectmodule.c:2353
#10 0x00007ffff5a1f84d in g_logv (log_domain=0x7ffff5a5bc86 "GLib", 
    log_level=<optimized out>, format=
    0x7ffff5a62380 "Failed to read from child watch wake up pipe: %s", args1=
    0x7ffff4fd9d18) at /tmp/buildd/glib2.0-2.30.2/./glib/gmessages.c:545
#11 0x00007ffff5a1fc02 in g_log (log_domain=<optimized out>, 
    log_level=<optimized out>, format=<optimized out>)
    at /tmp/buildd/glib2.0-2.30.2/./glib/gmessages.c:591
#12 0x00007ffff5a12cd6 in unix_signal_helper_thread (data=<optimized out>)
    at /tmp/buildd/glib2.0-2.30.2/./glib/gmain.c:4545
#13 0x00007ffff5a3c7e6 in g_thread_create_proxy (data=0xaa3df0)
    at /tmp/buildd/glib2.0-2.30.2/./glib/gthread.c:1962
#14 0x00007ffff7bc7b50 in start_thread (arg=<optimized out>)
    at pthread_create.c:304
#15 0x00007ffff6a5a3bd in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#16 0x0000000000000000 in ?? ()


More information about the pkg-gnome-maintainers mailing list