apitrace/apitrace — Issue #52: segfault in replayStateFound
Author: nobled
Created: 2011-11-12 02:53:43+00:00
State: open

revision: 38c932b18ad60176980f0c99f202c610757c000a

I get segfaults at random when retracing to do state lookup in qapitrace, but the only reliable way I found to reproduce a crash is like this:

1. Run qapitrace under gdb
2. start a 'Lookup State' operation
3. Ctrl+C to interrupt it, then resume the program.

It triggers a null deref like this:

^C
Program received signal SIGINT, Interrupt.
0x00007ffff3f2cf03 in poll () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) cont
Continuing.
Process error = 1
err = "1297: warning: could not infer drawable size (glViewport never called)
2784: warning: unsupported glXSwapIntervalSGI call
"
" out = "
[Thread 0x7fffd978a700 (LWP 14816) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00000000004336ee in ApiTraceEvent::setState (this=0x0, state=0x7fffd4000aa0) at /home/nobled/code/apitrace/gui/apitracecall.cpp:612
612	m_state = state;
(gdb) bt
#0 0x00000000004336ee in ApiTraceEvent::setState (this=0x0, state=0x7fffd4000aa0) at /home/nobled/code/apitrace/gui/apitracecall.cpp:612
#1 0x00000000004583da in MainWindow::replayStateFound (this=0x7fffffffde80, state=0x7fffd4000aa0) at /home/nobled/code/apitrace/gui/mainwindow.cpp:807
#2 0x000000000045aad1 in MainWindow::qt_metacall (this=0x7fffffffde80, _c=QMetaObject::InvokeMetaMethod, _id=7, _a=0x7fffffffc940) at /home/nobled/code/apitrace-build4/gui/mainwindow.moc:146
#3 0x00007ffff4afa5f8 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#4 0x0000000000465729 in Retracer::foundState (this=0xab8740, _t1=0x7fffd4000aa0) at /home/nobled/code/apitrace-build4/gui/retracer.moc:213
#5 0x0000000000465646 in Retracer::qt_metacall (this=0xab8740, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fffd4098940) at /home/nobled/code/apitrace-build4/gui/retracer.moc:191
#6 0x00007ffff4af949a in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#7 0x00007ffff59719f4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#8 0x00007ffff59763ba in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#9 0x00007ffff4ae549c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#10 0x00007ffff4ae8c25 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#11 0x00007ffff4b10253 in ?? () from /usr/lib/libQtCore.so.4
#12 0x00007ffff2aebbcd in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff2aec3a8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#14 0x00007ffff2aec639 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007ffff4b103ef in QEventDispatcherGlib::processEvents(QFlags) () from /usr/lib/libQtCore.so.4
#16 0x00007ffff5a1b4de in ?? () from /usr/lib/libQtGui.so.4
#17 0x00007ffff4ae4882 in QEventLoop::processEvents(QFlags) () from /usr/lib/libQtCore.so.4
#18 0x00007ffff4ae4abc in QEventLoop::exec(QFlags) () from /usr/lib/libQtCore.so.4
#19 0x00007ffff5e32fd6 in QDialog::exec() () from /usr/lib/libQtGui.so.4
#20 0x00007ffff5e534a2 in ?? () from /usr/lib/libQtGui.so.4
#21 0x00007ffff5e5359f in QMessageBox::warning(QWidget*, QString const&, QString const&, QFlags, QMessageBox::StandardButton) () from /usr/lib/libQtGui.so.4
#22 0x0000000000454a1c in MainWindow::replayError (this=0x7fffffffde80, message=...) at /home/nobled/code/apitrace/gui/mainwindow.cpp:232
#23 0x000000000045aaf3 in MainWindow::qt_metacall (this=0x7fffffffde80, _c=QMetaObject::InvokeMetaMethod, _id=8, _a=0x7fffffffd500) at /home/nobled/code/apitrace-build4/gui/mainwindow.moc:147
#24 0x00007ffff4afa5f8 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#25 0x0000000000465771 in Retracer::error (this=0xab8740, _t1=...) at /home/nobled/code/apitrace-build4/gui/retracer.moc:220
#26 0x0000000000465665 in Retracer::qt_metacall (this=0xab8740, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffd40a2800) at /home/nobled/code/apitrace-build4/gui/retracer.moc:192
#27 0x00007ffff4af949a in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#28 0x00007ffff59719f4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#29 0x00007ffff59763ba in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#30 0x00007ffff4ae549c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#31 0x00007ffff4ae8c25 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#32 0x00007ffff4b10253 in ?? () from /usr/lib/libQtCore.so.4
#33 0x00007ffff2aebbcd in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007ffff2aec3a8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007ffff2aec639 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#36 0x00007ffff4b103ef in QEventDispatcherGlib::processEvents(QFlags) () from /usr/lib/libQtCore.so.4
#37 0x00007ffff5a1b4de in ?? () from /usr/lib/libQtGui.so.4
#38 0x00007ffff4ae4882 in QEventLoop::processEvents(QFlags) () from /usr/lib/libQtCore.so.4
#39 0x00007ffff4ae4abc in QEventLoop::exec(QFlags) () from /usr/lib/libQtCore.so.4
#40 0x00007ffff4ae8ecb in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#41 0x00000000004630b7 in main (argc=2, argv=0x7fffffffe238) at /home/nobled/code/apitrace/gui/main.cpp:33
(gdb) up
#1 0x00000000004583da in MainWindow::replayStateFound (this=0x7fffffffde80, state=0x7fffd4000aa0)	at /home/nobled/code/apitrace/gui/mainwindow.cpp:807
807	m_stateEvent->setState(state);
(gdb) print m_stateEvent
$1 = (ApiTraceEvent *) 0x0
(gdb)

Using this trace, btw - http://www.mediafire.com/?a4l90bbkoo2e0an