.. happily, it allows the exclusion of reportbug as the cause of the
problem and begins to point fairly squarely at python-gtk2.
happening.  Please consider reassigning to the python-gtk2 package.

The mutex which is initialized in gtk.gdk.threads_init() is used
(attempted to be unlocked) at the site of the crash.  

Anyway, here's the script

#!/usr/bin/python
import gtk
gtk.gdk.threads_init()
raw_input("If this didn't crash, hit enter.")

As far as I can see, this program complies with the advice in the PyGTK
FAQ on using threads in pygtk programs, as does this equally crashy
program: http://faq.pygtk.org/index.py?req=show&file=faq20.001.htp

#!/usr/bin/python
import gtk
gtk.gdk.threads_init()
gtk.main()  # if this doesn't crash, hit ctrl-c

(the faq, possibly erroneously, does not advise that the main thread
must also call gtk.gdk.threads_enter() before calling gtk.main())

This program is regularly fatal on my Debian kFreeBSD system, but not on my
Debian GNU/Linux system, both running squeeze.  However, now that I know where
to look, this problem can be diagnosed on GNU/Linux systems under helgrind,
though on these systems it does not seem to be a fatal error under typical
conditions:

$ valgrind --tool=helgrind -- python -c 'import gtk; gtk.gdk.threads_init(); 
raw_input("")'
==13073== Helgrind, a thread error detector
==13073== Copyright (C) 2007-2011, and GNU GPL'd, by OpenWorks LLP et al.
==13073== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==13073== Command: python -c import\ gtk;\ gtk.gdk.threads_init();\ 
raw_input("\>")
==13073== 

/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could 
not open display
  warnings.warn(str(e), _gtk.Warning)
==13073== ---Thread-Announcement------------------------------------------
==13073== 
==13073== Thread #1 is the program's root thread
==13073== 
==13073== ----------------------------------------------------------------
==13073== 
==13073== Thread #1 unlocked a not-locked lock at 0xD48E460
==13073==    at 0x4C2BF9D: pthread_mutex_unlock (hg_intercepts.c:609)
==13073==    by 0x71C4450: g_mutex_unlock (gthread-posix.c:227)
==13073==    by 0x829078E: gtk_main (in 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.10)
==13073==    by 0x7E46C23: ??? (in 
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so)
==13073==    by 0x486172: ??? (in /usr/bin/python2.7)
==13073==    by 0x486258: PyOS_StdioReadline (in /usr/bin/python2.7)
==13073==    by 0x48655F: PyOS_Readline (in /usr/bin/python2.7)
==13073==    by 0x562F91: ??? (in /usr/bin/python2.7)
==13073==    by 0x4EAA3A: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==13073==    by 0x4F1DAF: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==13073==    by 0x4EA6F5: PyRun_StringFlags (in /usr/bin/python2.7)
==13073==    by 0x4F3088: PyRun_SimpleStringFlags (in /usr/bin/python2.7)
==13073==   Lock at 0xD48E460 was first observed
==13073==    at 0x4C2B79A: pthread_mutex_init (hg_intercepts.c:429)
==13073==    by 0x71C4146: g_mutex_impl_new (gthread-posix.c:99)
==13073==    by 0x71C43E8: g_mutex_init (gthread-posix.c:167)
==13073==    by 0x715CC95: g_mutex_new (gthread-deprecated.c:1473)
==13073==    by 0x87B3738: gdk_threads_init (in 
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0.2400.10)
==13073==    by 0x7E7BEAE: ??? (in 
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so)
==13073==    by 0x4EB52B: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==13073==    by 0x4F1DAF: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==13073==    by 0x4EA6F5: PyRun_StringFlags (in /usr/bin/python2.7)
==13073==    by 0x4F3088: PyRun_SimpleStringFlags (in /usr/bin/python2.7)
==13073==    by 0x4DA1A3: Py_Main (in /usr/bin/python2.7)
==13073==    by 0x5F4EEAC: (below main) (libc-start.c:228)
==13073== 
==13073== ----------------------------------------------------------------
==13073== 
==13073== Thread #1: Exiting thread still holds 1 lock
==13073==    at 0x5FDBF68: _Exit (_exit.c:33)
==13073==    by 0x5F66D9D: __run_exit_handlers (exit.c:93)
==13073==    by 0x5F66E44: exit (exit.c:100)
==13073==    by 0x5F4EEB3: (below main) (libc-start.c:260)
==13073== 
==13073== 
==13073== For counts of detected and suppressed errors, rerun with: -v
==13073== Use --history-level=approx or =none to gain increased speed, at
==13073== the cost of reduced accuracy of conflicting-access information
==13073== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)


Package: python-gtk2
Version: 2.24.0-3

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 9.0-2-amd64
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-gtk2 depends on:
ii  libatk1.0-0                       2.4.0-2
ii  libc0.1                           2.13-37
ii  libcairo2                         1.12.2-2
ii  libfontconfig1                    2.9.0-7
ii  libfreetype6                      2.4.9-1
ii  libgdk-pixbuf2.0-0                2.26.1-1
ii  libglib2.0-0                      2.33.12+really2.32.4-3
ii  libgtk2.0-0                       2.24.10-2
ii  libpango1.0-0                     1.30.0-1
ii  python                            2.7.3~rc2-1
ii  python-cairo                      1.8.8-1+b2
ii  python-gobject-2                  2.28.6-10
ii  python-numpy [python-numpy-abi9]  1:1.6.2-1
ii  python2.6                         2.6.8-0.2
ii  python2.7                         2.7.3~rc2-2.1

-- System Information:
Debian Release: wheezy/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-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/dash

Versions of packages python-gtk2 depends on:
ii  libatk1.0-0                       2.4.0-2
ii  libc6                             2.13-37
ii  libcairo2                         1.12.2-2
ii  libfontconfig1                    2.9.0-7
ii  libfreetype6                      2.4.9-1
ii  libgdk-pixbuf2.0-0                2.26.1-1
ii  libglib2.0-0                      2.33.12+really2.32.4-3
ii  libgtk2.0-0                       2.24.10-2
ii  libpango1.0-0                     1.30.0-1
ii  python                            2.7.3~rc2-1
ii  python-cairo                      1.8.8-1+b2
ii  python-gobject-2                  2.28.6-10
ii  python-numpy [python-numpy-abi9]  1:1.6.2-1
ii  python2.6                         2.6.8-0.2
ii  python2.7                         2.7.3~rc2-2.1

Jeff


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to