Comment 14 for bug 120278

Revision history for this message
Alon Levy (alonlevy1) wrote :

Preliminaries:
I'm using gutsy

This is definetly a wx problem, but the callstack showes the most recent call as libg. I can trigger it easily with the following python script
(I run it with "cat | python")

import ctypes
gt=ctypes.CDLL('/usr/lib/libgthread-2.0.so.0')
gt.g_thread_init(ctypes.c_voidp(0))

import wx

class BugApp(wx.App):
    def OnInit(self):
        self.frame = frame = wx.Frame(None)
        # double free or corruption
        b = wx.Button(frame, -1, "dfree | corruption", (20,20))
        # stranger stuff
        b = wx.Button(frame, -1, "free or corruption", (20,20))
        self.Bind(wx.EVT_BUTTON, self.OnButton, b)
        frame.Show()
        return True

    def OnButton(self, evt):
        wx.TextEntryDialog(self.frame, "some text", "some text")

app = BugApp()
app.MainLoop()

btw, if you change the length of the title in the wx.Button you get different errors - so basically there is some bad pointer arithmetic going on in that wx.Button call (which is of course a wrapper for the real wxWidgets call).

(it crashes when you press the button)

HTH,

Alon

p.s. The 3 first lines from the stack trace:
*** glibc detected *** python: munmap_chunk(): invalid pointer: 0x085795a0 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(cfree+0x1bb)[0xb7eae6eb]
/usr/lib/libglib-2.0.so.0(g_free+0x31)[0xb7cc58e1]
/usr/lib/libwx_gtk2u_core-2.8.so.0[0xb755aa70]