Bug 491 - Segfault when clicking trigger icons multiple times
Summary: Segfault when clicking trigger icons multiple times
Status: RESOLVED FIXED
Alias: None
Product: PulseView
Classification: Unclassified
Component: Triggers (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-22 17:32 CET by Uwe Hermann
Modified: 2014-11-24 01:15 CET (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Hermann 2014-11-22 17:32:43 CET
There seem to be some conditions where a PulseView crash can be caused by clicking on some of the trigger icons multiple times.

How to reproduce:

Start PV, select any FX2 based LA, click on any probe, randomly click on a some of the trigger icons until PV crashes:

Segmentation fault (core dumped)


Backtrace:

(gdb) bt
#0  0x00007f7cfc8f6873 in sigrok::Session::set_trigger (this=0x10cb990, trigger=std::shared_ptr (empty) 0x0) at ../bindings/cxx/classes.cpp:1141
#1  0x000000000047a987 in pv::view::LogicSignal::modify_trigger (this=0x10cc7d0) at pv/view/logicsignal.cpp:376
#2  0x00007f7cfafb490d in QMetaObject::activate (sender=sender@entry=0x119ded0, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fff3f32a890) at kernel/qobject.cpp:3681
#3  0x00007f7cfafb4d77 in QMetaObject::activate (sender=sender@entry=0x119ded0, m=m@entry=0x7f7cfd58a500 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fff3f32a890)
    at kernel/qobject.cpp:3547
#4  0x00007f7cfce9f732 in QAction::triggered (this=this@entry=0x119ded0, _t1=true) at .moc/moc_qaction.cpp:359
#5  0x00007f7cfcea1db8 in QAction::activate (this=0x119ded0, event=<optimized out>) at kernel/qaction.cpp:1175
#6  0x00007f7cfcfa264d in QAbstractButtonPrivate::click (this=0x11a66e0) at widgets/qabstractbutton.cpp:524
#7  0x00007f7cfcfa2864 in QAbstractButton::mouseReleaseEvent (this=0x11a70f0, e=0x7fff3f32ada0) at widgets/qabstractbutton.cpp:1140
#8  0x00007f7cfd06b00a in QToolButton::mouseReleaseEvent (this=<optimized out>, e=<optimized out>) at widgets/qtoolbutton.cpp:616
#9  0x00007f7cfcee5148 in QWidget::event (this=0x11a70f0, event=0x7fff3f32ada0) at kernel/qwidget.cpp:8316
#10 0x00007f7cfcfa3f13 in QAbstractButton::event (this=this@entry=0x11a70f0, e=e@entry=0x7fff3f32ada0) at widgets/qabstractbutton.cpp:1097
#11 0x00007f7cfd06b0e9 in QToolButton::event (this=0x11a70f0, event=0x7fff3f32ada0) at widgets/qtoolbutton.cpp:965
#12 0x00007f7cfcea6f3c in QApplicationPrivate::notify_helper (this=0xdf4720, receiver=0x11a70f0, e=0x7fff3f32ada0) at kernel/qapplication.cpp:3499
#13 0x00007f7cfceac97c in QApplication::notify (this=0x11a70f0, receiver=0x0, e=0x7fff3f32ada0) at kernel/qapplication.cpp:3066
#14 0x000000000044c2f6 in Application::notify (this=<optimized out>, receiver=<optimized out>, event=<optimized out>) at pv/application.cpp:38
#15 0x00007f7cfaf85f1b in QCoreApplication::notifyInternal (this=0x7fff3f32b610, receiver=receiver@entry=0x11a70f0, event=event@entry=0x7fff3f32ada0) at kernel/qcoreapplication.cpp:935
#16 0x00007f7cfceab11a in sendSpontaneousEvent (event=0x7fff3f32ada0, receiver=0x11a70f0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:240
#17 QApplicationPrivate::sendMouseEvent (receiver=0x11a70f0, event=0x7fff3f32ada0, alienWidget=0x11a70f0, nativeWidget=0x10cb660, buttonDown=<optimized out>, lastMouseReceiver=..., spontaneous=true)
    at kernel/qapplication.cpp:2539
#18 0x00007f7cfcf03754 in QWidgetWindow::handleMouseEvent (this=0x11a78e0, event=0x7fff3f32b1d0) at kernel/qwidgetwindow.cpp:411
#19 0x00007f7cfcf05dd3 in QWidgetWindow::event (this=0x11a78e0, event=0x7fff3f32b1d0) at kernel/qwidgetwindow.cpp:179
#20 0x00007f7cfcea6f3c in QApplicationPrivate::notify_helper (this=0xdf4720, receiver=0x11a78e0, e=0x7fff3f32b1d0) at kernel/qapplication.cpp:3499
#21 0x00007f7cfceac380 in QApplication::notify (this=0x7fff3f32b610, receiver=0x11a78e0, e=0x7fff3f32b1d0) at kernel/qapplication.cpp:3282
#22 0x000000000044c2f6 in Application::notify (this=<optimized out>, receiver=<optimized out>, event=<optimized out>) at pv/application.cpp:38
#23 0x00007f7cfaf85f1b in QCoreApplication::notifyInternal (this=0x7fff3f32b610, receiver=0x11a78e0, event=0x7fff3f32b1d0) at kernel/qcoreapplication.cpp:935
#24 0x00007f7cfd69c5c3 in sendSpontaneousEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:240
#25 QGuiApplicationPrivate::processMouseEvent (e=0x11b6c30) at kernel/qguiapplication.cpp:1748
#26 0x00007f7cfd69de25 in QGuiApplicationPrivate::processWindowSystemEvent (e=e@entry=0x11b6c30) at kernel/qguiapplication.cpp:1549
#27 0x00007f7cfd68355f in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:579
#28 0x00007f7cf30f5f50 in userEventSourceDispatch (source=<optimized out>) at eventdispatchers/qeventdispatcher_glib.cpp:78
#29 0x00007f7cfbe89c5d in g_main_dispatch (context=0x7f7ce80016f0) at /build/glib2.0-dt6trg/glib2.0-2.42.0/./glib/gmain.c:3111
#30 g_main_context_dispatch (context=context@entry=0x7f7ce80016f0) at /build/glib2.0-dt6trg/glib2.0-2.42.0/./glib/gmain.c:3710
#31 0x00007f7cfbe89f48 in g_main_context_iterate (context=context@entry=0x7f7ce80016f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /build/glib2.0-dt6trg/glib2.0-2.42.0/./glib/gmain.c:3781
#32 0x00007f7cfbe89ffc in g_main_context_iteration (context=0x7f7ce80016f0, may_block=1) at /build/glib2.0-dt6trg/glib2.0-2.42.0/./glib/gmain.c:3842
#33 0x00007f7cfafdd537 in QEventDispatcherGlib::processEvents (this=0xe2a1d0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#34 0x00007f7cfaf83752 in QEventLoop::exec (this=this@entry=0x7fff3f32b570, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#35 0x00007f7cfaf8b1cc in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1188
#36 0x00007f7cfd69419c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1483
#37 0x00007f7cfcea5595 in QApplication::exec () at kernel/qapplication.cpp:2744
#38 0x000000000044789e in main (argc=1, argv=<optimized out>) at main.cpp:164
Comment 1 Uwe Hermann 2014-11-22 21:20:32 CET
I've added a bunch of unit tests for the sr_trigger_*() API calls in libsigrok here:

http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff;h=c8412d6c69d20e3a91616321c748265edc15a17e

All of those succeed but I'm still seeing this bug, so I assume it's either related to the bindings or PulseView.
Comment 2 Uwe Hermann 2014-11-24 01:15:26 CET
Fixed in e835e8080b6278137ea90f3b10e5d8bc51136a91.