Hi, I'm writing a multi-threaded script with wxPython as a GUI toolkit. About 50% of the time, I can run my script flawlessly. The other 50% of the time, I get huge errors regarding wxPython that I cannot seem to decipher; however, I think it could possibly be a problem with one of my lists? I'm not sure what information I post will be helpful, so just request whatever else you feel would be necessary in fixing this error. I will try to respond as promptly as I can.

OS: Ubuntu 9.10 64 bit
Python Version: 2.6

I guess I should probably start by simply posting the error. Here you go.

*** glibc detected *** python: corrupted double-linked list: 0x0000000001568f30 ***
======= Backtrace: =========
======= Memory map: ========
00400000-0060f000 r-xp 00000000 08:01 3875 /usr/bin/python2.6
0080e000-0080f000 r--p 0020e000 08:01 3875 /usr/bin/python2.6
0080f000-00870000 rw-p 0020f000 08:01 3875 /usr/bin/python2.6
00870000-0087e000 rw-p 00000000 00:00 0
014ba000-02018000 rw-p 00000000 00:00 0 [heap]
7f16b4000000-7f16b4021000 rw-p 00000000 00:00 0
7f16b4021000-7f16b8000000 ---p 00000000 00:00 0
7f16ba22d000-7f16ba22e000 ---p 00000000 00:00 0
7f16ba22e000-7f16baa2e000 rw-p 00000000 00:00 0
7f16baa2e000-7f16baa2f000 ---p 00000000 00:00 0
7f16baa2f000-7f16bb22f000 rw-p 00000000 00:00 0
7f16bb22f000-7f16bb23a000 r-xp 00000000 08:01 7401 /lib/libudev.so.0.5.0
7f16bb23a000-7f16bb43a000 ---p 0000b000 08:01 7401 /lib/libudev.so.0.5.0
7f16bb43a000-7f16bb43b000 r--p 0000b000 08:01 7401 /lib/libudev.so.0.5.0
7f16bb43b000-7f16bb43c000 rw-p 0000c000 08:01 7401 /lib/libudev.so.0.5.0
7f16bb43c000-7f16bb465000 r-xp 00000000 08:01 1049167 /usr/lib/gio/modules/libgvfsdbus.so
7f16bb465000-7f16bb664000 ---p 00029000 08:01 1049167 /usr/lib/gio/modules/libgvfsdbus.so
7f16bb664000-7f16bb665000 r--p 00028000 08:01 1049167 /usr/lib/gio/modules/libgvfsdbus.so
7f16bb665000-7f16bb666000 rw-p 00029000 08:01 1049167 /usr/lib/gio/modules/libgvfsdbus.so
7f16bb666000-7f16bb67d000 r-xp 00000000 08:01 2970 /usr/lib/libgvfscommon.so.0.0.0
7f16bb67d000-7f16bb87c000 ---p 00017000 08:01 2970 /usr/lib/libgvfscommon.so.0.0.0
7f16bb87c000-7f16bb87d000 r--p 00016000 08:01 2970 /usr/lib/libgvfscommon.so.0.0.0
7f16bb87d000-7f16bb87e000 rw-p 00017000 08:01 2970 /usr/lib/libgvfscommon.so.0.0.0
7f16bb87e000-7f16bb891000 r-xp 00000000 08:01 1049166 /usr/lib/gio/modules/libgioremote-volume-monitor.so
7f16bb891000-7f16bba90000 ---p 00013000 08:01 1049166 /usr/lib/gio/modules/libgioremote-volume-monitor.so
7f16bba90000-7f16bba91000 r--p 00012000 08:01 1049166 /usr/lib/gio/modules/libgioremote-volume-monitor.so
7f16bba91000-7f16bba92000 rw-p 00013000 08:01 1049166 /usr/lib/gio/modules/libgioremote-volume-monitor.so
7f16bbe61000-7f16bbec1000 rw-s 00000000 00:09 42827794 /SYSV00000000 (deleted)
7f16bbec1000-7f16bbec5000 r-xp 00000000 08:01 1189002 /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
7f16bbec5000-7f16bc0c5000 ---p 00004000 08:01 1189002 /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
7f16bc0c5000-7f16bc0c6000 r--p 00004000 08:01 1189002 /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
7f16bc0c6000-7f16bc0c7000 rw-p 00005000 08:01 1189002 /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
7f16bc0c7000-7f16bc0c9000 r-xp 00000000 08:01 787061 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
7f16bc0c9000-7f16bc2c8000 ---p 00002000 08:01 787061 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
7f16bc2c8000-7f16bc2c9000 r--p 00001000 08:01 787061 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
7f16bc2c9000-7f16bc2ca000 rw-p 00002000 08:01 787061 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
7f16bc2ca000-7f16bc362000 r--p 00000000 08:01 919813 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
7f16bc362000-7f16bc39f000 r-xp 00000000 08:01 558 /lib/libdbus-1.so.3.4.0
7f16bc39f000-7f16bc59f000 ---p 0003d000 08:01 558 /lib/libdbus-1.so.3.4.0
7f16bc59f000-7f16bc5a0000 r--p 0003d000 08:01 558 /lib/libdbus-1.so.3.4.0
7f16bc5a0000-7f16bc5a1000 rw-p 0003e000 08:01 558 /lib/libdbus-1.so.3.4.0
7f16bc5a1000-7f16bc5de000 r-xp 00000000 08:01 3947 /usr/lib/libibus.so.1.0.0
7f16bc5de000-7f16bc7dd000 ---p 0003d000 08:01 3947 /usr/lib/libibus.so.1.0.0
7f16bc7dd000-7f16bc7df000 r--p 0003c000 08:01 3947 /usr/lib/libibus.so.1.0.0
7f16bc7df000-7f16bc7e0000 rw-p 0003e000 08:01 3947 /usr/lib/libibus.so.1.0.0
7f16bc7e0000-7f16bc7e1000 rw-p 00000000 00:00 0
7f16bc7e1000-7f16bc7e6000 r-xp 00000000 08:01 1180252 /usr/lib/gtk-2.0/2.10.0/immodules/im-ibus.soAborted

Any ideas on what I can do?

Thanks very much in advance.

Recommended Answers

All 4 Replies

I don't know what you are doing but in C++ version you should write no GUI functionality on secondary thread. All GUI issues should Go to primary one and others to secondary.

Sorry, I'm just having a little bit of trouble understanding what you are trying to say. Do you want me to have two threads running, and have one with a GUI and one without?

Let me try to explain my script a little further. The way I'm doing it right now, I only have two threads; thread one solely takes care of the "main loop" of the GUI, and the second thread wakes up every 100 milliseconds and checks the values of various variables in the script. If the values are as expected, it causes the GUI to change in some way.

Any other ideas on what could be causing this?

Thanks again.

I have a little bit of an update. I took my GUI "mainloop" out of a separate thread in hope I would get a more descriptive error message, which I did. Here are the two I get most frequently:

(python:2641): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators

Segmentation fault

(python:2520): Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion `layout->wrap_loop_count == 0' failed

Also, I frequently get a simple "Segmentation fault," with no other error message. What the heck is going on?

Well, I think I may have found my solution. After running threads at different times or eliminating them altogether, I believe I may know what was causing the error. I believe two threads were occasionally trying to write to a text buffer simultaneously through the same instance and that just decimated everything. After making sure only one thread has access to the text buffer, the problem has ceased (for the last hour, at least).

So, I believe my problem has been solved; hopefully this can help somebody in the future.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.