[PyKDE] Double free() problem in PyQt 3.15.1??

Jim Bublitz jbublitz at nwinternet.com
Sun Mar 12 17:48:18 GMT 2006


On Sunday 12 March 2006 07:04, Phil Thompson wrote:
> On Sunday 12 March 2006 10:04 am, Simon Edwards wrote:
> > On Saturday 11 March 2006 20:26, Phil Thompson wrote:
> > > On Saturday 11 March 2006 7:13 pm, Simon Edwards wrote:
> > > > Anyway, I think I've come across a double free memory bug in PyQt
> > > > 3.15.1. Qt complains about a "Double QObject deletion detected.", and
> > > > valgrind points to a problem in sipKDialogBase::~sipKDialogBase().
> > > > (Reading memory which is already free'd, and invalid free(), delete
> > > > etc). This problem
> >
> > only
> >
> > > > appears when my app opens a dialog.
> >
> > OK, I've chopped my code right down See attachment. Running this on the
> > current Kubuntu Dapper shows this in the console:
> >
> > sbe at dapper3:~$ python ./qdialogdoublefree.py
> > kbuildsycoca running...
> > Double QObject deletion detected.
> > *** glibc detected *** double free or corruption (!prev): 0x082cfa40 ***
> > KCrash: Application 'qdialogdoublefree.py' crashing...
> > sbe at dapper3:~$
> >
> > Using show() instead of exec_loop() does in fact _not_ trigger the
> > problem.
>
> Attached is a PyQt only version which doesn't seem to have a problem (have
> I removed too much?). This is using latest snapshots.

On a 1/10 PyQt snapshot I get:

*** glibc detected *** double free or corruption (!prev): 0x081fc950 ***
Alarm clock

when I close the application, but only if the QDialog has been instantiated at 
least once (by pushing the button).  It works fine until I close the 
application. I don't know where the "Alarm clock" is coming from - a SIGALRM 
someplace? I don't get the Qt error or KCrash though.

I get the same thing if I create a main window and run KApplication's event 
loop and then instantiate the KDialogBase object with the main window as its 
parent. In that case,  the double free is happening before 
QApplication.quit() is called from "lastWindowClosed" (and KApplication uses 
QApplication's quit())

However, if I make UserEditDialog parentless (pass None instead of self - 
where "self" would be the KDialogBase obj), it works fine (as provided by 
Simon or with the KMainWindow).

Jim




More information about the PyQt mailing list