How to reproduce: - Start PV, load an .sr file. - Switch to the demo driver. - Switch back to the loaded file -> segfault.
Backtrace: #1 0x080bff6d in std::__throw_bad_weak_ptr () at /usr/lib/gcc/i686-pc-linux-gnu/4.8.4/include/g++-v4/bits/shared_ptr_base.h:76 #2 0xb70f974f in _M_add_ref_lock (this=<optimized out>) at /usr/lib/gcc/i686-pc-linux-gnu/4.8.4/include/g++-v4/bits/shared_ptr_base.h:240 #3 __shared_count (__r=..., this=0xbfffcffc) at /usr/lib/gcc/i686-pc-linux-gnu/4.8.4/include/g++-v4/bits/shared_ptr_base.h:699 #4 __shared_ptr<sigrok::Context> (__r=..., this=0xbfffcff8) at /usr/lib/gcc/i686-pc-linux-gnu/4.8.4/include/g++-v4/bits/shared_ptr_base.h:807 #5 shared_ptr<sigrok::Context> (__r=std::weak_ptr (empty) 0x0, this=0xbfffcff8) at /usr/lib/gcc/i686-pc-linux-gnu/4.8.4/include/g++-v4/bits/shared_ptr.h:249 #6 shared_from_this (this=0x8134b50) at /usr/lib/gcc/i686-pc-linux-gnu/4.8.4/include/g++-v4/bits/shared_ptr.h:557 #7 shared_from_this (this=0x8134b50) at ./bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp:210 #8 sigrok::Context::load_session (this=0x8134b50, filename="1mhz_clock_1channels.sr") at bindings/cxx/classes.cpp:291 #9 0x080b1275 in pv::devices::SessionFile::create (this=0x8332828) at pulseview/pv/devices/sessionfile.cpp:41 #10 0x0809f22f in pv::Session::set_device (this=this@entry=0xbfffe974, device=std::shared_ptr (count 21, weak 1) 0x8332828) at pulseview/pv/session.cpp:135 #11 0x08096d04 in pv::MainWindow::select_device (this=0xbfffe95c, device=std::shared_ptr (count 21, weak 1) 0x8332828) at pulseview/pv/mainwindow.cpp:205 #12 0x080bceb5 in pv::toolbars::MainBar::on_device_selected (this=0x8178168) at pulseview/pv/toolbars/mainbar.cpp:545 #13 0x080eb975 in pv::toolbars::MainBar::qt_static_metacall (_o=<optimized out>, _id=<optimized out>, _a=<optimized out>, _c=<optimized out>) at pulseview/pv/toolbars/moc_mainbar.cxx:55 #14 0xb72a8f17 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/qt4/libQtCore.so.4 #15 0x080edbc7 in pv::widgets::DeviceToolButton::device_selected (this=this@entry=0x8178184) at pulseview/pv/widgets/moc_devicetoolbutton.cxx:107 #16 0x080da92a in pv::widgets::DeviceToolButton::on_action (this=0x8178184, action=0x84420f0) at pulseview/pv/widgets/devicetoolbutton.cpp:124
Fix here: https://github.com/martinling/pulseview/commit/26f81103f8be00f132921565700e5b2e260fabf8
Fixed in 8fe262de9a59039431bd3b4d9a7b3ee4a4429d4d, thanks!