[webkit-qt] Possible race condition in QWebPage deletion?

wargand at gmx.de wargand at gmx.de
Sat May 19 02:41:10 PDT 2012

I have a very ugly problem, and I am more and more sure it might be not
my code.

I used a QWebPage to render a page into an image. More or less my code
looks like the example here: http://qt-project.org/doc/qt-4.8/qwebpage.html 

The only difference is that my QWebPage is created on the heap, not on
the stack. After the image is rendered I do a page->deleteLater().

Under Linux I have no problems at all. I instantiate and delete several
hundred QWebPages within an hour. The program runs without any problems
at least for eight hours.

Now I also want to run it on OS X. I have two Macs to test. On one it
reproducably crashes within the first two minutes. The other, same code
crashes totally unpredictably. Sometimes after ten minutes, sometimes
after an hour.

The core file always shows only the main function of my programm, an then
dies somewhere in the webkit/apple libs.

What I suspect is that there is a race condition after my deleteLater().
Some parts of the QWebPage trying to execute already dead parts. But I
must admit, the webkit internals are way beyond my field.

Any ideas? Anyone interested in a backtrace? Small compilable example
isn't really helpful this time, it it really is a race condition.


More information about the webkit-qt mailing list