Is there any way to catch a segfault caused by Qt (for example, to log it to a file, etc)? I've tried installing a handler for the SIGSEGV signal, but it doesn't seem to work when a segfault occurs within PyQt. Example:<br>
<br>#####################<br><br># install a signal handler<br>import signal<br>def handler(signum, frame):<br> print "Signal handler for signal", signum<br>signal.signal(signal.SIGSEGV, handler)<br><br>from PyQt4.QtCore import *<br>
from PyQt4.QtGui import *<br><br>app = QApplication([])<br><br>model = QStandardItemModel(1,1)<br>model.setItem(0,0,QStandardItem("foo"))<br><br>proxyModel = QSortFilterProxyModel()<br>proxyModel.setSourceModel(model)<br>
<br># cause a Segmentation fault to happen<br>print "causing segfault"<br>index = proxyModel.index(0,0)<br>print index.internalPointer()<br><br>app.exec_()<br><br>########################<br><br>when I run this, the program just hangs forever, and I never see the print statement in my handler.<br>