Is there any way to catch a segfault caused by Qt (for example, to log it to a file, etc)? I&#39;ve tried installing a handler for the SIGSEGV signal, but it doesn&#39;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 &quot;Signal handler for signal&quot;, 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(&quot;foo&quot;))<br><br>proxyModel = QSortFilterProxyModel()<br>proxyModel.setSourceModel(model)<br>

<br># cause a Segmentation fault to happen<br>print &quot;causing segfault&quot;<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>