Application Crushes With lot of ( *** glibc detected *** python: double free or corruption (!prev): 0x0a1f1d00 ***) while Loading Many Icons when client connection Recieved.

I have an application which is networked it will basiclly work as a server
where clients connect and then be controlled by the server after they have
connected. Every client that connects the Server loads an Icon for that
Client.
Here comes a problem when the there are as many icons or connected clients
as 15 + the application crushes, Living behind lots of
-----backtraces------- which i have no idea about.

Something even more confusing is that some times it will crush when there
are few client or icons as 8 and sometimes it crushes when there are as many
client or icons as possible like 30+. I can't seem to understand this
indifferences.

This only happens when i ENABLE the codes that load the icons when client
connection are recieved. But when i don't enable to codes Loading the client
icons when connected the application does not crush.
In every crush i rcieved different error messages

HERE ARE SOME OF THE SNAPSHOTS I TOOK IN DIFFERENT STAGES OF THE CRUSH.
<http://wxpython-users.1045709.n5.nabble.com/file/n5717954/16.png>

<http://wxpython-users.1045709.n5.nabble.com/file/n5717954/55.png>

HERE ARE SOME OF THE CRUSH ERRORS I RECIEVE

*** glibc detected *** python: double free or corruption (!prev): 0x0a1f1d00

···

***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x75ee2)[0xb738cee2]
/lib/i386-linux-gnu/libglib-2.0.so.0(+0x4cd6b)[0xb6222d6b]
/lib/i386-linux-gnu/libglib-2.0.so.0(g_free+0x20)[0xb6222ff0]
/usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0(+0x2c2e7)[0xb63982e7]
/usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0(gdk_region_intersect+0xb5)[0xb6398be5]
/usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0(+0x37b0b)[0xb63a3b0b]
/usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0(gdk_window_process_all_updates+0x12f)[0xb63a604f]
/usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0(+0x3a0c8)[0xb63a60c8]
/usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0(+0x14f88)[0xb6380f88]
/lib/i386-linux-gnu/libglib-2.0.so.0(+0x43fd0)[0xb6219fd0]
/lib/i386-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x146)[0xb621cd46]
/lib/i386-linux-gnu/libglib-2.0.so.0(+0x470e5)[0xb621d0e5]
/lib/i386-linux-gnu/libglib-2.0.so.0(g_main_loop_run+0x7b)[0xb621d52b]
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0(gtk_main+0xaf)[0xb6550b8f]
/usr/lib/i386-linux-gnu/libwx_gtk2u_core-2.8.so.0(_ZN11wxEventLoop3RunEv+0x4a)[0xb6c0263a]
/usr/lib/i386-linux-gnu/libwx_gtk2u_core-2.8.so.0(_ZN9wxAppBase8MainLoopEv+0x4f)[0xb6c8790f]
/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so(_ZN7wxPyApp8MainLoopEv+0x43)[0xb6ed7523]
/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so(+0x3b9b4)[0xb6ef49b4]
python(PyEval_EvalFrameEx+0x3e35)[0x8198565]
python(PyEval_EvalCodeEx+0x150)[0x819af70]
python[0x819c82e]
python(PyObject_Call+0x3f)[0x81287ef]
python[0x80d8e37]
python(PyObject_Call+0x3f)[0x81287ef]
python(PyEval_EvalFrameEx+0xab6)[0x81951e6]
python(PyEval_EvalFrameEx+0x7bc)[0x8194eec]
python(PyEval_EvalCodeEx+0x150)[0x819af70]
python[0x819c82e]
python(PyObject_Call+0x3f)[0x81287ef]
python[0x80d8e37]
python(PyObject_Call+0x3f)[0x81287ef]
python(PyEval_CallObjectWithKeywords+0x39)[0x8128c59]
/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so(_ZN12wxPyCallback12EventThunkerER7wxEvent+0x122)[0xb6edae12]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZNK12wxAppConsole11HandleEventEP12wxEvtHandlerMS0_FvR7wxEventES3_+0x28)[0xb69ab038]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler21ProcessEventIfMatchesERK21wxEventTableEntryBasePS_R7wxEvent+0x7a)[0xb6a3a78a]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler23SearchDynamicEventTableER7wxEvent+0x61)[0xb6a3abb1]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0xbc)[0xb6a3ac9c]
/usr/lib/i386-linux-gnu/libwx_gtk2u_core-2.8.so.0(_ZN12wxWindowBase9TryParentER7wxEvent+0x53)[0xb6d001e3]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x86)[0xb6a3ac66]
/usr/lib/i386-linux-gnu/libwx_gtk2u_core-2.8.so.0(_ZN12wxWindowBase9TryParentER7wxEvent+0x53)[0xb6d001e3]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x86)[0xb6a3ac66]
/usr/lib/i386-linux-gnu/libwx_gtk2u_core-2.8.so.0(+0x1776aa)[0xb6c476aa]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOIDv+0x33)[0xb630b4a3]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(+0xd987)[0xb6309987]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(g_signal_emit_valist+0x449)[0xb6322fb9]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(g_signal_emit+0x33)[0xb63239e3]
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0(gtk_button_clicked+0x8a)[0xb649421a]
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0(+0x7a630)[0xb6495630]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOID+0x8c)[0xb630b44c]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(+0xc55d)[0xb630855d]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(g_closure_invoke+0x184)[0xb63096e4]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(+0x1fad5)[0xb631bad5]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(g_signal_emit_valist+0xcfc)[0xb632386c]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(g_signal_emit+0x33)[0xb63239e3]
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0(gtk_button_released+0x8a)[0xb649413a]
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0(+0x79184)[0xb6494184]
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0(+0x1388a2)[0xb65538a2]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(+0xc55d)[0xb630855d]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(g_closure_invoke+0x184)[0xb63096e4]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(+0x1fcad)[0xb631bcad]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(g_signal_emit_valist+0xa15)[0xb6323585]
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0(g_signal_emit+0x33)[0xb63239e3]
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0(+0x272413)[0xb668d413]
======= Memory map: ========
08048000-0829e000 r-xp 00000000 08:01 4598590 /usr/bin/python2.7
0829e000-0829f000 r--p 00256000 08:01 4598590 /usr/bin/python2.7
0829f000-082f4000 rw-p 00257000 08:01 4598590 /usr/bin/python2.7
082f4000-08300000 rw-p 00000000 00:00 0
096bb000-0a299000 rw-p 00000000 00:00 0 [heap]
a91f7000-a91f8000 ---p 00000000 00:00 0
a91f8000-a99f8000 rw-p 00000000 00:00 0
a99f8000-a99f9000 ---p 00000000 00:00 0
a99f9000-aa1f9000 rw-p 00000000 00:00 0
aa1f9000-aa1fa000 ---p 00000000 00:00 0
aa1fa000-aa9fa000 rw-p 00000000 00:00 0
aa9fa000-aa9fb000 ---p 00000000 00:00 0
aa9fb000-ab1fb000 rw-p 00000000 00:00 0
ab1fb000-ab1fc000 ---p 00000000 00:00 0
ab1fc000-ab9fc000 rw-p 00000000 00:00 0
ab9fc000-ab9fd000 ---p 00000000 00:00 0
ab9fd000-ac1fd000 rw-p 00000000 00:00 0
ac1fd000-ac1fe000 ---p 00000000 00:00 0
ac1fe000-ac9fe000 rw-p 00000000 00:00 0
ac9fe000-ac9ff000 ---p 00000000 00:00 0
ac9ff000-ad1ff000 rw-p 00000000 00:00 0
ad1ff000-ad200000 ---p 00000000 00:00 0
ad200000-ada00000 rw-p 00000000 00:00 0
ada00000-ada21000 rw-p 00000000 00:00 0
ada21000-adb00000 ---p 00000000 00:00 0
adb34000-adbe4000 r--p 00000000 08:01 5901019
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
adbe4000-adbe5000 ---p 00000000 00:00 0
adbe5000-ae3e5000 rw-p 00000000 00:00 0
ae3e5000-ae3ff000 r-xp 00000000 08:01 4724887
/usr/lib/i386-linux-gnu/libdbusmenu-glib.so.4.0.13
ae3ff000-ae400000 r--p 00019000 08:01 4724887
/usr/lib/i386-linux-gnu/libdbusmenu-glib.so.4.0.13
ae400000-ae401000 rw-p 0001a000 08:01 4724887
/usr/lib/i386-linux-gnu/libdbusmenu-glib.so.4.0.13
ae401000-ae412000 r-xp 00000000 08:01 4724889
/usr/lib/i386-linux-gnu/libdbusmenu-gtk.so.4.0.13
ae412000-ae413000 r--p 00010000 08:01 4724889
/usr/lib/i386-linux-gnu/libdbusmenu-gtk.so.4.0.13
ae413000-ae414000 rw-p 00011000 08:01 4724889
/usr/lib/i386-linux-gnu/libdbusmenu-gtk.so.4.0.13
ae414000-ae55b000 r-xp 00000000 08:01 4725466
/usr/lib/i386-linux-gnu/libxml2.so.2.7.8
ae55b000-ae55f000 r--p 00147000 08:01 4725466
/usr/lib/i386-linux-gnu/libxml2.so.2.7.8
ae55f000-ae560000 rw-p 0014b000 08:01 4725466
/usr/lib/i386-linux-gnu/libxml2.so.2.7.8
ae560000-ae561000 rw-p 00000000 00:00 0
ae561000-ae599000 r-xp 00000000 08:01 4724858
/usr/lib/i386-linux-gnu/libcroco-0.6.so.3.0.1
ae599000-ae59a000 ---p 00038000 08:01 4724858
/usr/lib/i386-linux-gnu/libcroco-0.6.so.3.0.1Aborted (core dumped)

------------------
(program exited with code: 134)
Press return to continue

SECOND ERROR MESSAGE AFTER THE SECOND CRUSH

**
Gdk:ERROR:/build/buildd/gtk+2.0-2.24.10/gdk/gdkregion-generic.c:337:miSetExtents:
assertion failed: (pExtents->y1 < pExtents->y2)
Aborted (core dumped)

HERE ARE THE CODES THAT LOAD THE ICONS WHEN CLIENTS ARE CONNECTED

#image attribute
        self.image = wx.ImageList(50,50)
        self.image_name = "icons/client-icons/ended.png"
        self.bitmap = wx.Bitmap(self.image_name, wx.BITMAP_TYPE_PNG)
        self.max_image = self.image.Add(self.bitmap)
        self.AssignImageList(self.image, wx.IMAGE_LIST_NORMAL)
    
    def add_icon( self, *args ):
        self.name = args
        
        if not len(self.name):
            wx.MessageBox("Client must have a unique name", "Failure",
                          wx.OK | wx.ICON_ERROR)
        else:
            self.img = 1 % (self.max_image+1)
            self.InsertImageStringItem(1, "%s" % self.name, self.img)

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Application-Crushes-With-lot-of-glibc-detected-python-double-free-or-corruption-prev-0x0a1f1d00-whil-tp5717954.html
Sent from the wxPython-users mailing list archive at Nabble.com.

want_learn1 wrote:


I have an application which is networked it will basiclly work as a server
where clients connect and then be controlled by the server after they have
connected. Every client that connects the Server loads an Icon for that
Client.
Here comes a problem when the there are as many icons or connected clients
as 15 + the application crushes, Living behind lots of
-----backtraces------- which i have no idea about.
Something even more confusing is that some times it will crush when there
are few client or icons as 8 and sometimes it crushes when there are as many
client or icons as possible like 30+. I can't seem to understand this
indifferences.
This only happens when i ENABLE the codes that load the icons when client
connection are recieved. But when i don't enable to codes Loading the client
icons when connected the application does not crush.
In every crush i rcieved different error messages

It sounds to me like you are probably trying to create or manipulate some UI object from a worker thread. That will almost always result in a
cra sh sooner or later. Keep in
mind that wx.Bitmaps and such are also UI objects.

···


Robin Dunn

Software Craftsman

http://wxPython.org