Bug 309443

Summary: crash while recording training data
Product: simon Reporter: Florian Reinhard <florian.reinhard>
Component: simonAssignee: Peter Grasch <me>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Florian Reinhard 2012-11-02 20:55:52 UTC
Note: a previous run of the same training data did work fine. i have no idea what triggers that crash.


Application: Simon (simon), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f953f2b6780 (LWP 1962))]

Thread 6 (Thread 0x7f9527b97700 (LWP 1963)):
#0  0x00007fff079bb98f in clock_gettime ()
#1  0x00007f953596f15d in clock_gettime () from /lib/x86_64-linux-gnu/librt.so.1
#2  0x00007f953bb4dbb4 in do_gettime (frac=0x7f9527b96ba8, sec=0x7f9527b96ba0) at tools/qelapsedtimer_unix.cpp:123
#3  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#4  0x00007f953bc25b8d in QTimerInfoList::updateCurrentTime (this=0x7f9520002860) at kernel/qeventdispatcher_unix.cpp:343
#5  0x00007f953bc25ec3 in QTimerInfoList::timerWait (this=0x7f9520002860, tm=...) at kernel/qeventdispatcher_unix.cpp:450
#6  0x00007f953bc2497c in timerSourcePrepareHelper (src=<optimized out>, timeout=0x7f9527b96c7c) at kernel/qeventdispatcher_glib.cpp:136
#7  0x00007f953bc24a25 in timerSourcePrepare (source=<optimized out>, timeout=<optimized out>) at kernel/qeventdispatcher_glib.cpp:169
#8  0x00007f95356bd846 in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007f95356bdf5b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007f95356be164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007f953bc25426 in QEventDispatcherGlib::processEvents (this=0x7f95200008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#12 0x00007f953bbf4c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#13 0x00007f953bbf4ed7 in QEventLoop::exec (this=0x7f9527b96de0, flags=...) at kernel/qeventloop.cpp:204
#14 0x00007f953baf3fa7 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#15 0x00007f953cee69ac in SocketThread::run (this=0x1b13310) at /home/freinhard/kde/src/simonsource/simon/src/simonrecognitioncontrol/threadedsslsocket.cpp:31
#16 0x00007f953baf6fcb in QThreadPrivate::start (arg=0x1b13310) at thread/qthread_unix.cpp:298
#17 0x00007f9535d7ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#18 0x00007f953a5cbcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#19 0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f9526d0c700 (LWP 1964)):
#0  0x00007fff079bb98f in clock_gettime ()
#1  0x00007f953596f15d in clock_gettime () from /lib/x86_64-linux-gnu/librt.so.1
#2  0x00007f953bb4dbb4 in do_gettime (frac=0x7f9526d0bb98, sec=0x7f9526d0bb90) at tools/qelapsedtimer_unix.cpp:123
#3  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#4  0x00007f953bc25b8d in QTimerInfoList::updateCurrentTime (this=0x7f9518002660) at kernel/qeventdispatcher_unix.cpp:343
#5  0x00007f953bc25ec3 in QTimerInfoList::timerWait (this=0x7f9518002660, tm=...) at kernel/qeventdispatcher_unix.cpp:450
#6  0x00007f953bc2497c in timerSourcePrepareHelper (src=<optimized out>, timeout=0x7f9526d0bc6c) at kernel/qeventdispatcher_glib.cpp:136
#7  0x00007f953bc24a25 in timerSourcePrepare (source=<optimized out>, timeout=<optimized out>) at kernel/qeventdispatcher_glib.cpp:169
#8  0x00007f95356bd846 in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007f95356bdf5b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007f95356be164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007f953bc25426 in QEventDispatcherGlib::processEvents (this=0x7f95180008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#12 0x00007f953bbf4c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#13 0x00007f953bbf4ed7 in QEventLoop::exec (this=0x7f9526d0bdd0, flags=...) at kernel/qeventloop.cpp:204
#14 0x00007f953baf3fa7 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#15 0x00007f953bbd49ff in QInotifyFileSystemWatcherEngine::run (this=0x1e07e70) at io/qfilesystemwatcher_inotify.cpp:248
#16 0x00007f953baf6fcb in QThreadPrivate::start (arg=0x1e07e70) at thread/qthread_unix.cpp:298
#17 0x00007f9535d7ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#18 0x00007f953a5cbcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#19 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f95250df700 (LWP 1972)):
#0  0x00007f953a5c0303 in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f9529a3035f in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#2  0x00007f9529a2176c in pa_mainloop_poll () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#3  0x00007f9529a21dd9 in pa_mainloop_iterate () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007f9529a21e90 in pa_mainloop_run () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007f9529a3030f in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007f95295d9d18 in ?? () from /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
#7  0x00007f9535d7ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007f953a5cbcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f95260e1700 (LWP 1973)):
[KCrash Handler]
#6  data (this=0x8) at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:135
#7  qGetPtrHelper<QScopedPointer<QObjectData> > (p=...) at ../../include/QtCore/../../src/corelib/global/qglobal.h:2430
#8  d_func (this=0x0) at ../../include/QtCore/../../src/corelib/io/qiodevice.h:168
#9  QIODevice::write (this=0x0, data=0x7f9508003de8 "\362\377\351\377\356\377\004", maxSize=1600) at io/qiodevice.cpp:1311
#10 0x00007f953da91447 in QIODevice::write (this=0x0, data=...) at /usr/include/qt4/QtCore/qiodevice.h:127
#11 0x00007f953da90e39 in WavRecorderClient::processPrivate (this=0x3224370, data=..., currentTime=3550) at /home/freinhard/kde/src/simonsource/simonlib/simonsound/wavrecorderclient.cpp:70
#12 0x00007f953da902ea in SoundInputClient::process (this=0x3224380, data=..., currentTime=3550) at /home/freinhard/kde/src/simonsource/simonlib/simonsound/soundinputclient.cpp:53
#13 0x00007f953da9694a in SimonSoundInput::processData (this=0x1d92d90, data=...) at /home/freinhard/kde/src/simonsource/simonlib/simonsound/simonsoundinput.cpp:57
#14 0x00007f953daa592f in SoundInputBuffer::run (this=0x215dda0) at /home/freinhard/kde/src/simonsource/simonlib/simonsound/soundinputbuffer.cpp:74
#15 0x00007f953baf6fcb in QThreadPrivate::start (arg=0x215dda0) at thread/qthread_unix.cpp:298
#16 0x00007f9535d7ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#17 0x00007f953a5cbcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#18 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f95248de700 (LWP 1974)):
#0  0x00007fff079bba56 in gettimeofday ()
#1  0x00007f953bb05b67 in QDateTime::currentDateTime () at tools/qdatetime.cpp:3133
#2  0x00007f953deef2db in Logger::log (message=..., type=Logger::Info) at /home/freinhard/kde/src/simonsource/simonlib/simonlogging/logger.cpp:85
#3  0x00007f953daa85ae in xrun_recovery (handle=0x1f90600, err=-5) at /home/freinhard/kde/src/simonsource/simonlib/simonsound/alsa/alsabackend.cpp:507
#4  0x00007f953daa8e1b in ALSACaptureLoop::run (this=0x241c8c0) at /home/freinhard/kde/src/simonsource/simonlib/simonsound/alsa/alsabackend.cpp:81
#5  0x00007f953baf6fcb in QThreadPrivate::start (arg=0x241c8c0) at thread/qthread_unix.cpp:298
#6  0x00007f9535d7ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7  0x00007f953a5cbcbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f953f2b6780 (LWP 1962)):
#0  0x00007f953a5be8bd in read () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f95356f88cf in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f95356bdba4 in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f95356bdfd6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f95356be164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f953bc253bf in QEventDispatcherGlib::processEvents (this=0x192e4b0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#6  0x00007f953b020d5e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#7  0x00007f953bbf4c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#8  0x00007f953bbf4ed7 in QEventLoop::exec (this=0x7fff078f03b0, flags=...) at kernel/qeventloop.cpp:204
#9  0x00007f953b448936 in QDialog::exec (this=0x210a4b0) at dialogs/qdialog.cpp:554
#10 0x000000000041cb73 in WelcomePage::startTraining (this=0x2367a00) at /home/freinhard/kde/src/simonsource/simon/src/welcomepage.cpp:259
#11 0x000000000040eb0a in WelcomePage::qt_static_metacall (_o=0x2367a00, _c=QMetaObject::InvokeMetaMethod, _id=9, _a=0x7fff078f0620) at /home/freinhard/kde/build/simonsource/simon/src/moc_welcomepage.cpp:80
#12 0x00007f953bc0a281 in QMetaObject::activate (sender=0x236a480, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff078f0620) at kernel/qobject.cpp:3547
#13 0x00007f953b608c72 in QAbstractButton::clicked (this=<optimized out>, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:220
#14 0x00007f953b346a4e in QAbstractButtonPrivate::emitClicked (this=<optimized out>) at widgets/qabstractbutton.cpp:548
#15 0x00007f953b347d8b in QAbstractButtonPrivate::click (this=0x23849b0) at widgets/qabstractbutton.cpp:541
#16 0x00007f953b347ffc in QAbstractButton::mouseReleaseEvent (this=0x236a480, e=0x7fff078f0ef0) at widgets/qabstractbutton.cpp:1123
#17 0x00007f953afc9144 in QWidget::event (this=0x236a480, event=0x7fff078f0ef0) at kernel/qwidget.cpp:8362
#18 0x00007f953af78894 in notify_helper (e=0x7fff078f0ef0, receiver=0x236a480, this=0x195aea0) at kernel/qapplication.cpp:4559
#19 QApplicationPrivate::notify_helper (this=0x195aea0, receiver=0x236a480, e=0x7fff078f0ef0) at kernel/qapplication.cpp:4531
#20 0x00007f953af7e0bf in QApplication::notify (this=<optimized out>, receiver=0x236a480, e=0x7fff078f0ef0) at kernel/qapplication.cpp:4102
#21 0x00007f953eca53f6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#22 0x00007f953bbf5e9c in QCoreApplication::notifyInternal (this=0x7fff078f1be0, receiver=0x236a480, event=0x7fff078f0ef0) at kernel/qcoreapplication.cpp:876
#23 0x00007f953af79862 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#24 QApplicationPrivate::sendMouseEvent (receiver=0x236a480, event=0x7fff078f0ef0, alienWidget=0x236a480, nativeWidget=0x2355be0, buttonDown=0x236a480, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3170
#25 0x00007f953aff8bf5 in QETWidget::translateMouseEvent (this=0x2355be0, event=<optimized out>) at kernel/qapplication_x11.cpp:4617
#26 0x00007f953aff7bae in QApplication::x11ProcessEvent (this=0x7fff078f1be0, event=0x7fff078f17c0) at kernel/qapplication_x11.cpp:3732
#27 0x00007f953b0210d2 in x11EventSourceDispatch (s=0x195d590, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#28 0x00007f95356bdd53 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007f95356be0a0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007f95356be164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007f953bc253bf in QEventDispatcherGlib::processEvents (this=0x192e4b0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#32 0x00007f953b020d5e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#33 0x00007f953bbf4c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#34 0x00007f953bbf4ed7 in QEventLoop::exec (this=0x7fff078f1b60, flags=...) at kernel/qeventloop.cpp:204
#35 0x00007f953bbf9f67 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#36 0x0000000000422cb9 in main (argc=1, argv=0x7fff078f1e78) at /home/freinhard/kde/src/simonsource/simon/src/main.cpp:91
Comment 1 Peter Grasch 2012-11-07 11:25:32 UTC
Can you describe what you did in a little bit more detail?

Are you using pulseaudio or plain ALSA?

Could you please also post the log at ~/.kde4/share/apps/simon/logs/protocol-<date>. Your backtrace indicates there were some problems with the actual recording.
Comment 2 Peter Grasch 2012-11-12 12:34:40 UTC
Git commit 9988ec08a3fd9248c129e222a12d4327d1029dfd by Peter Grasch.
Committed on 12/11/2012 at 13:03.
Pushed by grasch into branch 'master'.

Adding locking to sound input client

M  +17   -5    simonlib/simonsound/simonsoundinput.cpp
M  +3    -1    simonlib/simonsound/simonsoundinput.h
M  +8    -8    simonlib/simonsound/simonsoundoutput.cpp
M  +3    -3    simonlib/simonsound/simonsoundoutput.h

http://commits.kde.org/simon/9988ec08a3fd9248c129e222a12d4327d1029dfd
Comment 3 Peter Grasch 2012-11-12 12:36:10 UTC
I identified a race condition in the sound input layer that could potentially lead to the described crash. This commit should fix the problem but as I never experienced the crash myself (probably related to my audio configuration that appears to have very predictable timing), I can't really verify it.

If you still get the crash, please re-open the bug. Thanks.