Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Qt error message after closing the window #12

Open
severinsimmler opened this issue May 12, 2018 · 5 comments
Open

Qt error message after closing the window #12

severinsimmler opened this issue May 12, 2018 · 5 comments

Comments

@severinsimmler
Copy link

Your code works like a charm out-of-the-box, thank you! Anyway, I think I have discovered a cosmetic defect that does not affect the functionality of the program, but is probably easy to fix. I'm not deep enough into PyQt5 to know exactly what needs to be done, but maybe you can help out?

It must be the part that opens external links in the browser (I checked that):

class WebPage(QtWebEngineWidgets.QWebEnginePage):
def __init__(self, root_url):
super(WebPage, self).__init__()
self.root_url = root_url
def home(self):
self.load(QtCore.QUrl(self.root_url))
def acceptNavigationRequest(self, url, kind, is_main_frame):
"""Open external links in browser and internal links in the webview"""
ready_url = url.toEncoded().data().decode()
is_clicked = kind == self.NavigationTypeLinkClicked
if is_clicked and self.root_url not in ready_url:
QtGui.QDesktopServices.openUrl(url)
return False
return super(WebPage, self).acceptNavigationRequest(url, kind, is_main_frame)

With window stuff you often have to explicitly dispose the widgets before exiting the program. Otherwise it can happen that somewhere else an event listener gets an event and wants to do something, although parts of the program are already gone → segfault. Does this make sense?

When I run your app.py in the examples folder and close the Qt window again, I get the following error message in the console:

Received signal 11 SEGV_MAPERR 000000000000
#0 0x7f2642d0b9a5 <unknown>
#1 0x7f2641a4b501 <unknown>
#2 0x7f2642d0bd3d <unknown>
#3 0x7f26543db890 <unknown>
#4 0x7f264a2649a3 QGuiApplication::font()
#5 0x7f264aa79e29 QApplication::font()
#6 0x7f264aa7b1f3 QApplication::font()
#7 0x7f264aaa2fe1 QWidgetPrivate::naturalWidgetFont()
#8 0x7f264aaa968d QWidgetPrivate::resolveFont()
#9 0x7f264aab8427 QWidget::setParent()
#10 0x7f264aab8eac QWidget::setParent()
#11 0x7f26481def7a <unknown>
#12 0x7f26481dd26b <unknown>
#13 0x7f26481cdcc4 QWebEnginePage::~QWebEnginePage()
#14 0x7f26484089f9 sipQWebEnginePage::~sipQWebEnginePage()
#15 0x7f264b8f1686 forgetObject
#16 0x7f264b8f16a9 sipWrapper_dealloc
#17 0x0000004d8395 <unknown>
#18 0x00000048a6c4 <unknown>
#19 0x00000054f519 <unknown>
#20 0x00000054fe6d <unknown>
#21 0x0000005546cf _PyEval_EvalFrameDefault
#22 0x00000054fbe1 <unknown>
#23 0x000000550b93 PyEval_EvalCode
#24 0x00000042b519 PyRun_FileExFlags
#25 0x00000042b705 PyRun_SimpleFileExFlags
#26 0x000000441fcb Py_Main
#27 0x000000421ff4 main
#28 0x7f2653405b97 __libc_start_main
#29 0x0000004220aa _start
  r8: 000000000800f000  r9: 00007f26547f10a0 r10: 0000000002406d80 r11: 0000000000000000
 r12: 00007ffd4aeb7d50 r13: 00007f264a91b010 r14: 0000000000000000 r15: 0000000000000000
  di: 0000000000000000  si: 0000000000000000  bp: 00000000023b44d0  bx: 00007f264a91b118
  dx: 0000000000000001  ax: 00007f264a91b0a8  cx: 0000000000000016  sp: 00007ffd4aeb7c70
  ip: 00007f264a2649a3 efl: 0000000000010246 cgf: 002b000000000033 erf: 0000000000000004
 trp: 000000000000000e msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.

Can you reproduce that?

@severinsimmler
Copy link
Author

Really no idea? I think I'll find time for it soon, then I'll let you know how to fix it.

@danielgwilson
Copy link

I can confirm this bug—I reproduced this issue both with the RSS Reader example and my own project.

@severinsimmler
Copy link
Author

Great (or, not great, but you know what I mean), @danielgwilson. Do you have any expertise in the pyqt5 stuff?

@patarapolw
Copy link
Contributor

Don't know if it is the same, but I got

Received signal 11 SEGV_MAPERR 000000000000
 [0x000110a79de6]
 [0x7fff71a75f5a]
 [0x000000000009]
 [0x00010c6770ef]
 [0x00010c6a9ae7]
 [0x00010c6a9c55]
 [0x00010c6a04f4]
 [0x00010b7b60fb]
 [0x00010b7b3495]
 [0x00010b7a5ca3]
 [0x00010b76014c]
 [0x00010b6fb651]
 [0x00010b6fb3f6]
 [0x000108f4d877]
 [0x000108f19f54]
 [0x000108fc52b2]
 [0x000108f04d81]
 [0x000108fc45bb]
 [0x000108fc16a7]
 [0x000108f051f0]
 [0x000108fc45bb]
 [0x000108fc1601]
 [0x000108fc5096]
 [0x000108fbb244]
 [0x000108ff8041]
 [0x000108ff78eb]
 [0x00010901593c]
 [0x000109015da1]
 [0x7fff71767015]
[end of stack trace]

@BlackTurtle123
Copy link

I got this message:
Release of profile requested but WebEnginePage still not deleted. Expect troubles !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants