Crash in low level X window lib after using SetStatusText

Bug #555592 reported by Jerome Lacoste
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wxwidgets2.8 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

The bug is probably at a lower level, but is exhibited when I add the following code to my Python application:

class MyFramce(wx.Frame):
    def SomeFunction(self):
        self.SetStatusText(...., 0)

The exact commit that causes the crash in my application is isolated in that git branch:

http://github.com/lacostej/talkmore.no-apps/tree/py-statusbar-crashing

The application crashes 80% of the time with different error messages.

* crash style #1

python: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.

* crash style #2

The program 'python' received an X Window System error.
This probably reflects a bug in the program.
The error was 'RenderBadPicture (invalid Picture parameter)'.
  (Details: serial 1851 error_code 173 request_code 153 minor_code 6)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

* crash style #3

python: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
The program 'python' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
  (Details: serial 2924 error_code 14 request_code 153 minor_code 4)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

* crash style #4

python: ../../src/xcb_io.c:378: _XAllocID: Assertion `ret != inval_id' failed.
Aborted

* crash style #5

python: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
python: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
*** glibc detected *** /usr/bin/python: corrupted double-linked list: 0x0833f600 ***

Of these situations I sometimes get stacktraces using gdb in the following way: gdb --args python standalone_py/talkmore.py --sync

Sometimes the stacktrace isn't there at all.

Here are the 2 types of stack traces I managed to get after running about 50 sessions in gdb (of which abou 30% generate a stacktrace).

* stack trace type #1

python: ../../src/xcb_io.c:176: process_responses: Assertion `!(req && current_request && !(((long) (req->sequence) - (long) (current_request)) <= 0))' failed.2

Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()
(gdb) bt
#0 0x0012d422 in __kernel_vsyscall ()
#1 0x001b54d1 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2 0x001b8932 in *__GI_abort () at abort.c:92
#3 0x001ae648 in *__GI___assert_fail (assertion=0x164fbf4 "!(req && current_request && !(((long) (req->sequence) - (long) (current_request)) <= 0))", file=0x164fb29 "../../src/xcb_io.c", line=176,
    function=0x164fcd2 "process_responses") at assert.c:81
#4 0x015dffd3 in ?? () from /usr/lib/libX11.so.6
#5 0x015e0526 in _XReply () from /usr/lib/libX11.so.6
#6 0x015d41a7 in XSync () from /usr/lib/libX11.so.6
#7 0x015d4335 in ?? () from /usr/lib/libX11.so.6
#8 0x01769cf9 in XRenderChangePicture () from /usr/lib/libXrender.so.1
#9 0x01722e51 in ?? () from /usr/lib/libcairo.so.2
#10 0x017252d8 in ?? () from /usr/lib/libcairo.so.2
#11 0x01709bad in ?? () from /usr/lib/libcairo.so.2
#12 0x01709d45 in ?? () from /usr/lib/libcairo.so.2
#13 0x0170cc89 in ?? () from /usr/lib/libcairo.so.2
#14 0x0170ceaa in ?? () from /usr/lib/libcairo.so.2
#15 0x01709357 in ?? () from /usr/lib/libcairo.so.2
#16 0x016eff26 in ?? () from /usr/lib/libcairo.so.2
#17 0x016e9f4d in cairo_fill_preserve () from /usr/lib/libcairo.so.2
#18 0x016e9f72 in cairo_fill () from /usr/lib/libcairo.so.2
#19 0x0116a15f in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#20 0x0116bbcc in gdk_window_begin_paint_region () from /usr/lib/libgdk-x11-2.0.so.0
#21 0x00eab184 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#22 0x01175204 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#23 0x011751b3 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#24 0x011751b3 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#25 0x011751b3 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#26 0x011751b3 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#27 0x011751b3 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#28 0x011751b3 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#29 0x01198764 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#30 0x0116c7f9 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#31 0x0116e86f in gdk_window_process_all_updates () from /usr/lib/libgdk-x11-2.0.so.0
#32 0x00e1d37f in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#33 0x0114af78 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#34 0x0143d101 in ?? () from /lib/libglib-2.0.so.0
#35 0x0143ee88 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#36 0x01442730 in ?? () from /lib/libglib-2.0.so.0
#37 0x01442b9f in g_main_loop_run () from /lib/libglib-2.0.so.0
#38 0x00eab419 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#39 0x008b4c78 in wxEventLoop::Run() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#40 0x00947e3e in wxAppBase::MainLoop() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#41 0x002f4b42 in wxPyApp::MainLoop() () from /usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so
#42 0x00368e2a in ?? () from /usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so
#43 0x080dc131 in PyEval_EvalFrameEx ()
#44 0x080dddf2 in PyEval_EvalCodeEx ()
#45 0x0816014c in ?? ()
#46 0x0806120a in PyObject_Call ()
#47 0x080684ac in ?? ()
#48 0x0806120a in PyObject_Call ()
#49 0x080dbc3c in PyEval_EvalFrameEx ()
#50 0x080dd384 in PyEval_EvalFrameEx ()

* stack trace type #2

python: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
python: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
*** glibc detected *** /usr/bin/python: corrupted double-linked list: 0x0833f600 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0x1f5ff1]
/lib/tls/i686/cmov/libc.so.6[0x1f7a89]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0x1fa7cd]
/lib/tls/i686/cmov/libc.so.6[0x1ba088]
/lib/tls/i686/cmov/libc.so.6[0x1ba0cf]
/usr/lib/libgdk-x11-2.0.so.0[0x1192640]
/usr/lib/libX11.so.6(_XIOError+0x56)[0x15d82e6]
/usr/lib/libX11.so.6(_XReply+0x2f1)[0x15e0711]
/usr/lib/libX11.so.6(XSync+0x67)[0x15d41a7]
/usr/lib/libX11.so.6[0x15d4335]
/usr/lib/libX11.so.6(XChangeGC+0x5e)[0x15b2ede]
/usr/lib/libgdk-x11-2.0.so.0[0x118c8e5]
/usr/lib/libgdk-x11-2.0.so.0(gdk_gc_set_values+0x22e)[0x11542be]
/usr/lib/libgdk-x11-2.0.so.0(gdk_gc_set_clip_origin+0x93)[0x1154cd3]
/usr/lib/libgdk-x11-2.0.so.0[0x11734eb]
/usr/lib/libgdk-x11-2.0.so.0[0x1173901]
/usr/lib/libgdk-x11-2.0.so.0(gdk_draw_rectangle+0x111)[0x1150cd1]
/usr/lib/libgtk-x11-2.0.so.0[0xf35740]
/usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so[0x1f6cddb]
/usr/lib/libgtk-x11-2.0.so.0(gtk_paint_flat_box+0xf1)[0xf2f331]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZN8wxWindow18GtkSendPaintEventsEv+0x37b)[0x8cb7eb]
/usr/lib/libwx_gtk2u_core-2.8.so.0[0x8cbc18]
/usr/lib/libgtk-x11-2.0.so.0[0xeb1474]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1b2)[0x13bf072]
/usr/lib/libgobject-2.0.so.0[0x13d47a8]
/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x648)[0x13d59b8]
/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x26)[0x13d5fb6]
/usr/lib/libgtk-x11-2.0.so.0[0xfcd95e]
/usr/lib/libgtk-x11-2.0.so.0(gtk_main_do_event+0x500)[0xeab190]
/usr/lib/libgdk-x11-2.0.so.0[0x1175204]
/usr/lib/libgdk-x11-2.0.so.0[0x11751b3]
/usr/lib/libgdk-x11-2.0.so.0[0x11751b3]
/usr/lib/libgdk-x11-2.0.so.0[0x11751b3]
/usr/lib/libgdk-x11-2.0.so.0[0x11751b3]
/usr/lib/libgdk-x11-2.0.so.0[0x11751b3]
/usr/lib/libgdk-x11-2.0.so.0[0x11751b3]
/usr/lib/libgdk-x11-2.0.so.0[0x1198764]
/usr/lib/libgdk-x11-2.0.so.0[0x116c7f9]
/usr/lib/libgdk-x11-2.0.so.0(gdk_window_process_all_updates+0x13f)[0x116e86f]
/usr/lib/libgtk-x11-2.0.so.0[0xe1d37f]
/usr/lib/libgdk-x11-2.0.so.0[0x114af78]
/lib/libglib-2.0.so.0[0x143d101]
/lib/libglib-2.0.so.0(g_main_context_dispatch+0x1f8)[0x143ee88]
/lib/libglib-2.0.so.0[0x1442730]
/lib/libglib-2.0.so.0(g_main_loop_run+0x1bf)[0x1442b9f]
/usr/lib/libgtk-x11-2.0.so.0(gtk_main+0xb9)[0xeab419]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZN11wxEventLoop3RunEv+0x48)[0x8b4c78]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZN9wxAppBase8MainLoopEv+0x4e)[0x947e3e]
/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so(_ZN7wxPyApp8MainLoopEv+0x42)[0x2f4b42]
/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so[0x368e2a]
/usr/bin/python(PyEval_EvalFrameEx+0x42d1)[0x80dc131]
/usr/bin/python(PyEval_EvalCodeEx+0x7d2)[0x80dddf2]
/usr/bin/python[0x816014c]
/usr/bin/python(PyObject_Call+0x4a)[0x806120a]
/usr/bin/python[0x80684ac]
/usr/bin/python(PyObject_Call+0x4a)[0x806120a]
/usr/bin/python(PyEval_EvalFrameEx+0x3ddc)[0x80dbc3c]
/usr/bin/python(PyEval_EvalFrameEx+0x5524)[0x80dd384]
/usr/bin/python(PyEval_EvalFrameEx+0x5524)[0x80dd384]
/usr/bin/python(PyEval_EvalCodeEx+0x7d2)[0x80dddf2]
/usr/bin/python(PyEval_EvalCode+0x57)[0x80ddef7]
/usr/bin/python(PyRun_FileExFlags+0x9f)[0x80faa1f]
/usr/bin/python(PyRun_SimpleFileExFlags+0xc2)[0x80fac12]
======= Memory map: ========
00110000-0012b000 r-xp 00000000 08:01 2215704 /lib/ld-2.10.1.so
0012b000-0012c000 r--p 0001a000 08:01 2215704 /lib/ld-2.10.1.so
0012c000-0012d000 rw-p 0001b000 08:01 2215704 /lib/ld-2.10.1.so
0012d000-0012e000 r-xp 00000000 00:00 0 [vdso]
0012e000-00143000 r-xp 00000000 08:01 2235034 /lib/tls/i686/cmov/libpthread-2.10.1.so
00143000-00144000 r--p 00014000 08:01 2235034 /lib/tls/i686/cmov/libpthread-2.10.1.so
00144000-00145000 rw-p 00015000 08:01 2235034 /lib/tls/i686/cmov/libpthread-2.10.1.so
00145000-00147000 rw-p 00000000 00:00 0
00147000-00149000 r-xp 00000000 08:01 2234987 /lib/tls/i686/cmov/libdl-2.10.1.so
00149000-0014a000 r--p 00001000 08:01 2234987 /lib/tls/i686/cmov/libdl-2.10.1.so
0014a000-0014b000 rw-p 00002000 08:01 2234987 /lib/tls/i686/cmov/libdl-2.10.1.so
0014b000-0014d000 r-xp 00000000 08:01 2235039 /lib/tls/i686/cmov/libutil-2.10.1.so
0014d000-0014e000 r--p 00001000 08:01 2235039 /lib/tls/i686/cmov/libutil-2.10.1.so
0014e000-0014f000 rw-p 00002000 08:01 2235039 /lib/tls/i686/cmov/libutil-2.10.1.so
0014f000-00163000 r-xp 00000000 08:01 2215778 /lib/libz.so.1.2.3.3
00163000-00164000 r--p 00013000 08:01 2215778 /lib/libz.so.1.2.3.3
00164000-00165000 rw-p 00014000 08:01 2215778 /lib/libz.so.1.2.3.3
00165000-00189000 r-xp 00000000 08:01 2234988 /lib/tls/i686/cmov/libm-2.10.1.so
00189000-0018a000 r--p 00023000 08:01 2234988 /lib/tls/i686/cmov/libm-2.10.1.so
0018a000-0018b000 rw-p 00024000 08:01 2234988 /lib/tls/i686/cmov/libm-2.10.1.so
0018b000-002c9000 r-xp 00000000 08:01 2234783 /lib/tls/i686/cmov/libc-2.10.1.so
002c9000-002ca000 ---p 0013e000 08:01 2234783 /lib/tls/i686/cmov/libc-2.10.1.so
002ca000-002cc000 r--p 0013e000 08:01 2234783 /lib/tls/i686/cmov/libc-2.10.1.so
002cc000-002cd000 rw-p 00140000 08:01 2234783 /lib/tls/i686/cmov/libc-2.10.1.so
002cd000-002d0000 rw-p 00000000 00:00 0
002d0000-00412000 r-xp 00000000 08:01 2373787 /usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so
00412000-00413000 r--p 00141000 08:01 2373787 /usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so
00413000-0041e000 rw-p 00142000 08:01 2373787 /usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so
0041e000-004fb000 r-xp 00000000 08:01 1777841 /usr/lib/libwx_gtk2u_richtext-2.8.so.0.6.0
004fb000-00501000 r--p 000dd000 08:01 1777841 /usr/lib/libwx_gtk2u_richtext-2.8.so.0.6.0
00501000-00502000 rw-p 000e3000 08:01 1777841 /usr/lib/libwx_gtk2u_richtext-2.8.so.0.6.0
00502000-00504000 rw-p 00000000 00:00 0
00504000-0056e000 r-xp 00000000 08:01 1776621 /usr/lib/libwx_gtk2u_aui-2.8.so.0.6.0
0056e000-00571000 r--p 00069000 08:01 1776621 /usr/lib/libwx_gtk2u_aui-2.8.so.0.6.0
00571000-00572000 rw-p 0006c000 08:01 1776621 /usr/lib/libwx_gtk2u_aui-2.8.so.0.6.0
00572000-00573000 rw-p 00000000 00:00 0
00573000-00600000 r-xp 00000000 08:01 1777844 /usr/lib/libwx_gtk2u_xrc-2.8.so.0.6.0
00600000-00603000 r--p 0008c000 08:01 1777844 /usr/lib/libwx_gtk2u_xrc-2.8.so.0.6.0
00603000-00604000 rw-p 0008f000 08:01 1777844 /usr/lib/libwx_gtk2u_xrc-2.8.so.0.6.0
00604000-00605000 rw-p 00000000 00:00 0
00605000-00621000 r-xp 00000000 08:01 1777840 /usr/lib/libwx_gtk2u_qa-2.8.so.0.6.0
00621000-00623000 r--p 0001b000 08:01 1777840 /usr/lib/libwx_gtk2u_qa-2.8.so.0.6.0
00623000-00624000 rw-p 0001d000 08:01 1777840 /usr/lib/libwx_gtk2u_qa-2.8.so.0.6.0
00624000-006b9000 r-xp 00000000 08:01 1777836 /usr/lib/libwx_gtk2u_html-2.8.so.0.6.0
006b9000-006be000 r--p 00094000 08:01 1777836 /usr/lib/libwx_gtk2u_html-2.8.so.0.6.0
006be000-006bf000 rw-p 00099000 08:01 1777836 /usr/lib/libwx_gtk2u_html-2.8.so.0.6.0
006bf000-006c0000 rw-p 00000000 00:00 0
006c0000-00772000 r-xp 00000000 08:01 1776184 /usr/lib/libwx_gtk2u_adv-2.8.so.0.6.0
00772000-00773000 ---p 000b2000 08:01 1776184 /usr/lib/libwx_gtk2u_adv-2.8.so.0.6.0
00773000-0077b000 r--p 000b2000 08:01 1776184 /usr/lib/libwx_gtk2u_adv-2.8.so.0.6.0
0077b000-0077c000 rw-p 000ba000 08:01 1776184 /usr/lib/libwx_gtk2u_adv-2.8.so.0.6.0
0077c000-0077e000 rw-p 00000000 00:00 0
0077e000-00aae000 r-xp 00000000 08:01 1776782 /usr/lib/libwx_gtk2u_core-2.8.so.0.6.0
00aae000-00ad5000 r--p 0032f000 08:01 1776782 /usr/lib/libwx_gtk2u_core-2.8.so.0.6.0
00ad5000-00ada000 rw-p 00356000 08:01 1776782 /usr/lib/libwx_gtk2u_core-2.8.so.0.6.0
Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()

Note: using "xhost +" seems to reduce the risk of crashing the app. A bit. I still get crashes most of the time (> 50%).

Please provide some guidance as to where search further. Not having the ability to use a status bar in a GUI app seems constraining :)

Revision history for this message
Jerome Lacoste (jerome-lacoste) wrote :

I've made a smaller test case, which seems to pinpoint that the issue is somewhat thread related/triggered.

Revision history for this message
Jerome Lacoste (jerome-lacoste) wrote :

Got someone to reproduce a similar problem on Ubuntu 08.04

http://paste.ubuntu.com/409493/

Usign wx 2.8.7.1
python: ../../src/xcb_lock.c:77: _XGetXCBBuffer: Assertion `((int) ((xcb_req) - (dpy->request)) >= 0)' failed.
Aborted

Revision history for this message
Jerome Lacoste (jerome-lacoste) wrote :

This second version of the program works around the crash by appropriately forcing GUI updates on the event loop thread (using CallAfter).

This this issue is a programming error, but the crash was a bit hard to diagnose.

Changed in wxwidgets2.8 (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.