Running Spynner on Python 2.7 I get fairly regular segfaults.
The easiest way I can reproduce is this call to wk_click:
br.wk_click('img[id="continue"]', wait_load=True, timeout=60)
If it times-out I wasn't catching the SpynnerTimeout exception. So I'd get this in stderr:
Traceback (most recent call last):
File "test.py", line 13, in <module>
File "/usr/local/cuna/apps/submitter/submitter.py", line 186, in convert
File "/usr/local/cuna/apps/submitter/submitter.py", line 350, in validate
self.browser().wk_click('img[id="continue"]', wait_requests=1, wait_load=True, timeout=60)
File "/home/sharter/.virtualenvs/cana/local/lib/python2.7/site-packages/spynner/browser.py", line 747, in wk_click
return self.wk_click_element(element, wait_load=wait_load, wait_requests=wait_requests, timeout=timeout)
File "/home/sharter/.virtualenvs/cana/local/lib/python2.7/site-packages/spynner/browser.py", line 716, in wk_click_element
File "/home/sharter/.virtualenvs/cana/local/lib/python2.7/site-packages/spynner/browser.py", line 366, in _wait_load
raise SpynnerTimeout("Timeout reached: %d seconds" % timeout)
spynner.browser.SpynnerTimeout: Timeout reached: 60 seconds
Segmentation fault (core dumped)
So fine, I catch that exception. But during runtime, I see supervisord having to start the process several times a day when it segfaults and exits. Those cases aren't preceeded by uncaught exceptions so I'm not getting a stack trace, I just get the Segmentation Fault error.
Do you have any hints? Anything that is known to cause this issue in Spynner. I know a segfault is common with PyQt if Python is trying to access a Qt object that's been destroyed or likewise if Qt is trying to access a Python object that's been destroyed. But trying to find that bug is a needle in a giant stack of needles.
Can you trace the segfault with gdb please ?
When calling browser.close()
it always produce a Segmentation fault. Core dumped with the thread
Stacktrace is just useless for me but just in case:
[Thread 0x7fff7f700700 (LWP 6705) exited]
Program received signal SIGSEGV, Segmentation fault.
0x00007fffec3e5eb7 in QWebFrame::load(QNetworkRequest const&, QNetworkAccessManager::Operation, QByteArray const&) ()