-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
segmentation faults #186
Comments
I found that qt events are still running after the main frame has been loaded, when the Python is ready for exiting, update: I may not be quite right about |
I see the same stuff quite frequently. Unfortunately it seems to be in WebKit itself, not in any of the Python libs. Also I can't find any constant pattern - some sites crash on the first run, then they pass OK on the second run. |
@kravietz Could you paste few links that chrash? Are you also running osX? |
@kravietz You are right, after running my program for almost one month, the crashes were most likely random. |
Nope, it's crashing on Linux. Sample:
And then testing the same in command line:
Kernel says:
Actually, this particular page seems to be a good target for testing - out of 3 attempts one time it loaded OK, and twice it crashed with segmentationi fault... |
Actually, I think I've found it:
Will file a bug with WebKit for that. |
I am also troubled with the core. For some pages, it always causes core dumping during page loading. #0 0x00007f70dc327787 in QtMIMETypeSniffer::~QtMIMETypeSniffer() () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4 at libc-start.c:287 #33 0x000000000057497e in _start () (gdb) info threads Id Target Id Frame 7 Thread 0x7f708bfff700 (LWP 30545) 0x00007f70e4634c6d in poll () at ../sysdeps/unix/syscall-template.S:81 6 Thread 0x7f708ade2700 (LWP 30548) 0x00007f70e46398e3 in select () at ../sysdeps/unix/syscall-template.S:81 5 Thread 0x7f70916d0700 (LWP 30544) 0x00007f70e4634c6d in poll () at ../sysdeps/unix/syscall-template.S:81 4 Thread 0x7f708b7fe700 (LWP 30546) pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238 3 Thread 0x7f7092426700 (LWP 30543) pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185 2 Thread 0x7f70d4286700 (LWP 30541) pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
|
OK, I think I found the core-dumping case:
the direct way to avoid them is to disable them |
@HarryQian commented on 22 дек. 2014 г., 7:52 GMT+3:
But how do this? A can't find anything about disabling features in documentation. |
Now I am using PY-QT 5, it’s more efficient and really gets seldom core dump. |
I have Debian Wheezy on my servers... Installing Qt5 also update big part of system... Not good way. |
Harry: ghost doesnt work with qt5, just qt4. |
@petermat Actually it does, with this small patch #205 and you will also need Python3 as there's no PyQt5 for Python2 (at least not in Ubuntu). But it works suprisingly well:
Unfortunately, this fatal test site http://www.aleqt.com/2014/11/28/article_910177.html still causes a crash inside Qt5 libraries :( |
It keeps crashing randomly even on v0.2 ...
seems to always precede the crash |
settting session.page = None fixes it for me from ghost import Ghost
gho = Ghost()
with gho.start() as session:
page, extra_resources = session.open("https://ipsec.pl/")
assert page.http_status == 200
session.page = None |
for me help webkit=Ghost()
webkit.evaluate('window.WebSockets=undefined')
webkit.evaluate('window.localStorage=undefined')
webkit.evaluate('window.sessionStorage=undefined')
webkit.evaluate('window.RTCPeerConnection=undefined')
webkit.evaluate('window.webkitRTCPeerConnection=undefined')
webkit.evaluate('window.mozRTCPeerConnection=undefined') |
@Brainback if page is set to None, it will lead to a memory leak in the program. the memory will exhaust. |
I got the same problem. |
The real reason for having this bug is that you're using nonpatched qtwebkit. Try out the one from 2.3.2-0ubuntu9 (Ubuntu 16.04 or newer) and it should go away. |
@d33tah please consider giving a try at this branch (PySide2, Qt5): https://github.com/jeanphix/ghost.py/tree/pyside2 Cheers, |
@jeanphix TBH this bug is not affecting me, it's just number one in Google search for this segfault. I wanted to let others know because I had the same problem in another application using qtwebkit. |
@d33tah Sure, just I'd be happy to get feedback about the upcoming stuff :) |
@jeanphix I'm running pyside2 and still getting segfaults FYI |
@rcoh When does it happen? |
It's happening on the session.open call. Here's my flow:
Possibly the problem is that I'm opening multiple sessions? Having multiple sessions running at the same time is critical for my use case, however. |
@rcoh Can't reproduce it, can you write a tiny failing script? |
Hmm it appears to be related to the specific page I was loading...will have to debug more to figure out what about the page is causing the segfault. Is there anyway to get more of a stack trace? |
I think I found the problem.
It seems like a resource is getting loaded even after the session is closed. When a attempted to open a new session, we get a segfault. |
This is fixed if I use a
|
Although since as a function of this, I can't run concurrent sessions anyway without a segfault, this doesn't really work for me. |
yeah that looks like precisely the issue. Any idea about concurrent sessions? |
@rcoh having several sessions living at same time just works well, isn't it? |
hmm I got immediate segfaults. Will try to make a reproducer |
@jeanphix https://gist.github.com/rcoh/d8c119441f0b2789a36cc3368e1273c0 |
Completely missed this ping, sorry for this. I merged my network request tracker in ghost-py-0-2 branch this week as I was finally re-assigned to working on this. I am still tracking down some segfaults but it proves difficult. |
The program will exit with segmentation faults when loading some pages. But sometimes, these pages may be loaded normally and the program exits normally.
Report:
The text was updated successfully, but these errors were encountered: