Skip to content

Instantly share code, notes, and snippets.

@thefloweringash
Created August 22, 2013 04:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefloweringash/6303264 to your computer and use it in GitHub Desktop.
Save thefloweringash/6303264 to your computer and use it in GitHub Desktop.
pygtk crash after threads_init() but without threads_enter()
[lorne@xenon ~]$ cat crashme.py
#!/usr/local/bin/python2.7
import gtk.gdk
gtk.gdk.threads_init()
gtk.main()
[lorne@xenon ~]$ ./crashme.py
** (process:95092): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'
** (process:95092): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'
** (process:95092): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
GLib (gthread-posix.c): Unexpected error from C library during 'pthread_mutex_unlock': Operation not permitted. Aborting.
Abort trap: 6 (core dumped)
[lorne@xenon ~]$ /usr/local/bin/gdb /usr/local/bin/python2.7
GNU gdb (GDB) 7.6 [GDB v7.6 for FreeBSD]
Copyright (C) 2013 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-portbld-freebsd9.1".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/bin/python2.7...done.
(gdb) run ./crashme.py
Starting program: /usr/local/bin/python2.7 ./crashme.py
[New LWP 100115]
[New Thread 801407400 (LWP 100115)]
** (process:95094): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'
** (process:95094): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'
** (process:95094): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
GLib (gthread-posix.c): Unexpected error from C library during 'pthread_mutex_unlock': Operation not permitted. Aborting.
Program received signal SIGABRT, Aborted.
[Switching to Thread 801407400 (LWP 100115)]
0x000000080106924c in thr_kill () from /lib/libc.so.7
(gdb) bt
#0 0x000000080106924c in thr_kill () from /lib/libc.so.7
#1 0x000000080110b85b in abort () from /lib/libc.so.7
#2 0x000000080252072e in g_thread_abort (status=1, function=0x802578562 "pthread_mutex_unlock") at gthread-posix.c:76
#3 0x00000008025208d5 in g_mutex_unlock (mutex=0x80153d350) at gthread-posix.c:230
#4 0x00000008049d81d2 in gdk_threads_impl_unlock () at gdk.c:437
#5 0x000000080440a513 in IA__gtk_main () at gtkmain.c:1256
#6 0x0000000803f6c0fd in _wrap_gtk_main (self=0x0) at ./gtk.override:1240
#7 0x00000000004b6ee4 in call_function (pp_stack=0x7fffffffd4a0, oparg=0) at ./../Python/ceval.c:4005
#8 0x00000000004b34b5 in PyEval_EvalFrameEx (f=0x8014dd560, throwflag=0) at ./../Python/ceval.c:2666
#9 0x00000000004b53fc in PyEval_EvalCodeEx (co=0x801437db0, globals=0x8015567a0, locals=0x8015567a0, args=0x0, argcount=0, kws=0x0,
kwcount=0, defs=0x0, defcount=0, closure=0x0) at ./../Python/ceval.c:3253
#10 0x00000000004acb87 in PyEval_EvalCode (co=0x801437db0, globals=0x8015567a0, locals=0x8015567a0) at ./../Python/ceval.c:667
#11 0x00000000004e1a6b in run_mod (mod=0x8018cca78, filename=0x7fffffffdd99 "./crashme.py", globals=0x8015567a0, locals=0x8015567a0,
flags=0x7fffffffda40, arena=0x8014d4460) at ./../Python/pythonrun.c:1365
#12 0x00000000004e19e9 in PyRun_FileExFlags (fp=0x80135c620, filename=0x7fffffffdd99 "./crashme.py", start=257, globals=0x8015567a0,
locals=0x8015567a0, closeit=1, flags=0x7fffffffda40) at ./../Python/pythonrun.c:1351
#13 0x00000000004e0820 in PyRun_SimpleFileExFlags (fp=0x80135c620, filename=0x7fffffffdd99 "./crashme.py", closeit=1,
flags=0x7fffffffda40) at ./../Python/pythonrun.c:943
#14 0x00000000004e00d6 in PyRun_AnyFileExFlags (fp=0x80135c620, filename=0x7fffffffdd99 "./crashme.py", closeit=1, flags=0x7fffffffda40)
at ./../Python/pythonrun.c:747
#15 0x0000000000415361 in Py_Main (argc=2, argv=0x7fffffffdb40) at ./../Modules/main.c:640
#16 0x000000000041407e in main (argc=2, argv=0x7fffffffdb40) at ./../Modules/python.c:23
(gdb) up 5
#5 0x000000080440a513 in IA__gtk_main () at gtkmain.c:1256
1256 GDK_THREADS_LEAVE ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment