[PyQt] QtWebEngineWidgets crasher

Baz Walter bazwal at ftml.net
Thu Mar 19 17:35:24 GMT 2015

On 19/03/15 05:13, Florian Bruhin wrote:
> * Baz Walter <bazwal at ftml.net> [2015-03-19 03:15:03 +0000]:
>> On 19/03/15 02:47, Kovid Goyal wrote:
>>> Sounds like an object lifetime bug,
>>> try explicitly deleting widget after app.exec_()
>> No that doesn't work, but it's not the point anyway. It's trivial to find
>> several ways to "fix" my toy example - e.g. give the widget a parent, import
>> QtWebEngineWidgets globally, move app into the test function, etc, etc.
> I've added a QTimer to call app.closeAllWindows() after a second, left
> this run for about 3 hours on Archlinux - no crashes here. :-/

Thanks for trying. I'm also on ArchLinux (x86-64). Was it you who put up 
the repo with the qt5 debug packages? Many thanks if it was, because 
that saved me a lot of hassle (needless to say, it really, really sucks 
that arch has no official debug packages).

>> The question is why a non-global import of the QtWebEngineWidgets module
>> (and no other PyQt module) causes my test case to crash on exit. At the
>> moment, I can't find a way to debug it. Even with debug builds of PyQt5 and
>> Qt5, the backtrace seems pretty useless (I also tried valgrind with similar
>> results):
> I have similiar issues (though I only get segfaults in one of maybe 50
> runs) with my application without QtWebEngine. The backtraces usually
> look similiar. Unfortunately I've given up properly debugging this,
> but any pointers what to do to find out more would be welcome.

I've not been seriously using PyQt5 for long, but the only similar 
problem I've seen so far is when importing the Qt module in an 
interactive session. Obviously this will import QtWebEngineWidgets along 
with everything else, but it doesn't always crash on exit - it just 
depends on what other objects were created, and the order in which they 
were destroyed.

Baz Walter

More information about the PyQt mailing list