[PyQt] segmentation faults common when using QWebView
Hans-Peter Jansen
hpj at urpla.net
Tue Nov 30 15:23:33 GMT 2010
On Tuesday 30 November 2010, 16:09:09 Brandon Craig Rhodes wrote:
> "Hans-Peter Jansen" <hpj at urpla.net> writes:
> > Brandon, forgot to add:
> >
> > I bet, that the simplest version (just the first webview.load,
> > findAll, and click) as C++ version will also crash in a similar
> > way, pointing to some uncaught race between the operating theads.
> > It would be a very good idea to report that as Qt-bug...
>
> Thank you! I will indeed try reporting it. But - and here I might
> need a lesson in how Qt works - how are threads involved in my
> example? I had thought that setting a timer scheduled an event to
> happen in the main exec() thread, not over in another thread. If
> something I am doing is creating additional threads, then I'll
> rearrange my program to prevent it, since Qt explicitly says that all
> widget operations have to be invoked from the main application
> thread.
Nope, you cannot do anything in this case and its definitely not your
fault. Check my gdb run, there you will notice:
[New Thread 0xb456bb90 (LWP 10895)]
[New Thread 0xb3a43b90 (LWP 10897)]
which all happen behind the scenes. QtNetwork/QtWebkit do realize the
asynchonicity that way. And that's, where they get it wrong also, I
guess.. ;-)
Pete
More information about the PyQt
mailing list