Bug 1265 - segfault when changing voltage ranges on logc16 if bitstream unavailable
Summary: segfault when changing voltage ranges on logc16 if bitstream unavailable
Status: CONFIRMED
Alias: None
Product: PulseView
Classification: Unclassified
Component: Acquisition (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Low normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-18 15:08 CEST by karlp
Modified: 2018-08-31 08:04 CEST (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description karlp 2018-08-18 15:08:05 CEST
changed teh voltage thresholds and started an acquisition when the second bitstream wasn't available.

version: pulseview-0.3.0-630-g2a09e77




(gdb) run
Starting program: /home/karlp/.local/bin/pulseview 
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.26-28.fc27.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe2de4700 (LWP 28150)]
[New Thread 0x7fffd9134700 (LWP 28151)]
[New Thread 0x7fffd8933700 (LWP 28152)]
[New Thread 0x7fffd3fff700 (LWP 28153)]
[New Thread 0x7fffd3170700 (LWP 28154)]
[New Thread 0x7fffd26c7700 (LWP 28156)]
[New Thread 0x7fffbf2fe700 (LWP 28159)]
[Thread 0x7fffbf2fe700 (LWP 28159) exited]
[New Thread 0x7fffbeafd700 (LWP 28160)]
[Thread 0x7fffbeafd700 (LWP 28160) exited]
[New Thread 0x7fffbe2fc700 (LWP 28161)]
[Thread 0x7fffbe2fc700 (LWP 28161) exited]
[New Thread 0x7fffbdafb700 (LWP 28162)]
[Thread 0x7fffbdafb700 (LWP 28162) exited]
[New Thread 0x7fffbd2fa700 (LWP 28163)]
[Thread 0x7fffbd2fa700 (LWP 28163) exited]
[New Thread 0x7fffbcaf9700 (LWP 28164)]
[Thread 0x7fffbcaf9700 (LWP 28164) exited]
[New Thread 0x7fffb7fff700 (LWP 28165)]
[Thread 0x7fffb7fff700 (LWP 28165) exited]
[New Thread 0x7fffb77fe700 (LWP 28166)]
[Thread 0x7fffb77fe700 (LWP 28166) exited]
[New Thread 0x7fffb6ffd700 (LWP 28167)]
[Thread 0x7fffb6ffd700 (LWP 28167) exited]
[New Thread 0x7fffb67fc700 (LWP 28168)]
[Thread 0x7fffb67fc700 (LWP 28168) exited]
[New Thread 0x7fffb5ffb700 (LWP 28169)]
[Thread 0x7fffb5ffb700 (LWP 28169) exited]
[New Thread 0x7fffb57fa700 (LWP 28170)]
[Thread 0x7fffb57fa700 (LWP 28170) exited]
[New Thread 0x7fffb4ff9700 (LWP 28171)]
[Thread 0x7fffb4ff9700 (LWP 28171) exited]
[New Thread 0x7fffb47f8700 (LWP 28172)]
[Thread 0x7fffb47f8700 (LWP 28172) exited]
[New Thread 0x7fffb3ff7700 (LWP 28173)]
[Thread 0x7fffb3ff7700 (LWP 28173) exited]
[New Thread 0x7fffb37f6700 (LWP 28174)]
[Thread 0x7fffb37f6700 (LWP 28174) exited]
[New Thread 0x7fffb2a56700 (LWP 28220)]
[Thread 0x7fffb2a56700 (LWP 28220) exited]

Thread 1 "pulseview" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
Missing separate debuginfos, use: dnf debuginfo-install GConf2-3.2.6-19.fc27.x86_64 adwaita-qt5-1.0-3.fc27.x86_64 at-spi2-atk-2.26.1-1.fc27.x86_64 at-spi2-core-2.26.2-1.fc27.x86_64 atk-2.26.1-1.fc27.x86_64 boost-filesystem-1.64.0-7.fc27.x86_64 boost-serialization-1.64.0-7.fc27.x86_64 boost-system-1.64.0-7.fc27.x86_64 bzip2-libs-1.0.6-24.fc27.x86_64 cairo-1.15.10-1.fc27.x86_64 cairo-gobject-1.15.10-1.fc27.x86_64 dbus-glib-0.108-4.fc27.x86_64 dbus-libs-1.12.8-1.fc27.x86_64 dconf-0.26.1-1.fc27.x86_64 expat-2.2.5-1.fc27.x86_64 fontconfig-2.12.6-4.fc27.x86_64 freetype-2.8-8.fc27.x86_64 gdk-pixbuf2-2.36.11-1.fc27.x86_64 glib2-2.54.3-3.fc27.x86_64 glibmm24-2.54.1-1.fc27.x86_64 graphite2-1.3.10-3.fc27.x86_64 gtk3-3.22.26-2.fc27.x86_64 gvfs-client-1.34.2.1-1.fc27.x86_64 harfbuzz-1.4.8-1.fc27.x86_64 jasper-libs-2.0.14-5.fc27.x86_64 jbigkit-libs-2.1-8.fc27.x86_64 lcms2-2.8-5.fc27.x86_64 libICE-1.0.9-11.fc27.x86_64 libSM-1.2.2-7.fc27.x86_64 libX11-1.6.5-4.fc27.x86_64 libX11-xcb-1.6.5-4.fc27.x86_64 libXau-1.0.8-9.fc27.x86_64 libXcomposite-0.4.4-11.fc27.x86_64 libXcursor-1.1.15-1.fc27.x86_64 libXdamage-1.1.4-11.fc27.x86_64 libXext-1.3.3-7.fc27.x86_64 libXfixes-5.0.3-4.fc27.x86_64 libXi-1.7.9-4.fc27.x86_64 libXinerama-1.1.3-9.fc27.x86_64 libXrandr-1.5.1-4.fc27.x86_64 libXrender-0.9.10-4.fc27.x86_64 libXtst-1.2.3-4.fc27.x86_64 libXxf86vm-1.1.4-6.fc27.x86_64 libblkid-2.30.2-3.fc27.x86_64 libdatrie-0.2.9-6.fc27.x86_64 libdrm-2.4.91-1.fc27.x86_64 libepoxy-1.4.3-3.fc27.x86_64 libffi-3.1-14.fc27.x86_64 libgcc-7.3.1-6.fc27.x86_64 libgcrypt-1.8.3-1.fc27.x86_64 libglvnd-1.0.0-1.fc27.x86_64 libglvnd-glx-1.0.0-1.fc27.x86_64 libgpg-error-1.31-1.fc27.x86_64 libicu-57.1-9.fc27.x86_64 libjpeg-turbo-1.5.3-1.fc27.x86_64 libmng-2.0.3-6.fc27.x86_64 libmount-2.30.2-3.fc27.x86_64 libpciaccess-0.13.4-6.fc27.x86_64 libpng-1.6.31-1.fc27.x86_64 libselinux-2.7-3.fc27.x86_64 libsigc++20-2.10.0-4.fc27.x86_64 libstdc++-7.3.1-6.fc27.x86_64 libthai-0.1.25-4.fc27.x86_64 libtiff-4.0.9-10.fc27.x86_64 libusbx-1.0.21-4.fc27.x86_64 libuuid-2.30.2-3.fc27.x86_64 libwayland-client-1.14.0-2.fc27.x86_64 libwayland-cursor-1.14.0-2.fc27.x86_64 libwebp-1.0.0-1.fc27.x86_64 libxcb-1.12-5.fc27.x86_64 libxkbcommon-0.7.1-5.fc27.x86_64 libxkbcommon-x11-0.7.1-5.fc27.x86_64 libxshmfence-1.2-6.fc27.x86_64 libzip-1.3.2-1.fc27.x86_64 lz4-libs-1.8.0-1.fc27.x86_64 mesa-dri-drivers-17.3.9-1.fc27.x86_64 mesa-libGL-17.3.9-1.fc27.x86_64 mesa-libglapi-17.3.9-1.fc27.x86_64 mesa-libwayland-egl-17.3.9-1.fc27.x86_64 pango-1.40.14-1.fc27.x86_64 pcre-8.42-2.fc27.x86_64 pcre2-10.31-7.fc27.x86_64 pcre2-utf16-10.31-7.fc27.x86_64 pixman-0.34.0-4.fc27.x86_64 python3-libs-3.6.6-1.fc27.x86_64 qgnomeplatform-0.3-7.fc27.x86_64 qt5-qtbase-5.9.6-3.fc27.x86_64 qt5-qtbase-gui-5.9.6-3.fc27.x86_64 qt5-qtimageformats-5.9.6-1.fc27.x86_64 qt5-qtsvg-5.9.6-1.fc27.x86_64 sssd-client-1.16.2-4.fc27.x86_64 systemd-libs-234-11.git5f8984e.fc27.x86_64 xcb-util-0.4.0-8.fc27.x86_64 xcb-util-image-0.4.0-8.fc27.x86_64 xcb-util-keysyms-0.4.0-6.fc27.x86_64 xcb-util-renderutil-0.3.9-9.fc27.x86_64 xcb-util-wm-0.4.1-11.fc27.x86_64 xz-libs-5.2.3-4.fc27.x86_64 zlib-1.2.11-4.fc27.x86_64
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007ffff4cdbc8f in QAbstractAnimation::setCurrentTime(int) () at /lib64/libQt5Core.so.5
#2  0x00007ffff4cdbe77 in QAnimationTimer::updateAnimationsTime(long long) () at /lib64/libQt5Core.so.5
#3  0x00007ffff4cda28b in QUnifiedTimer::updateAnimationTimers(long long) () at /lib64/libQt5Core.so.5
#4  0x00007ffff4cdac6c in QAnimationDriver::advanceAnimation(long long) () at /lib64/libQt5Core.so.5
#5  0x00007ffff4ed430b in QObject::event(QEvent*) () at /lib64/libQt5Core.so.5
#6  0x00007ffff5b1792c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#7  0x00007ffff5b1f174 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#8  0x000000000047e3bd in Application::notify(QObject*, QEvent*) (this=<optimized out>, receiver=<optimized out>, event=<optimized out>) at /home/karlp/src/sigrok-playground/pulseview/pv/application.cpp:45
#9  0x00007ffff4eaacd7 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#10 0x00007ffff4efb04b in QTimerInfoList::activateTimers() () at /lib64/libQt5Core.so.5
#11 0x00007ffff4efb8e1 in timerSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQt5Core.so.5
#12 0x00007ffff6256b97 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#13 0x00007ffff6256f40 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#14 0x00007ffff6256fcc in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#15 0x00007ffff4efbd1f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /lib64/libQt5Core.so.5
#16 0x00007ffff4ea9a3a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#17 0x00007ffff4eb2194 in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#18 0x000000000047c061 in main(int, char**) (argc=<optimized out>, argv=<optimized out>)
    at /home/karlp/src/sigrok-playground/pulseview/main.cpp:335
(gdb)
Comment 1 Soeren Apel 2018-08-18 16:56:17 CEST
Two issues here:

1) There is no PV code involved in the crash, it is literally all Qt and glib code - suggesting that it's a bug in Qt. Still, odd nonetheless.
2) You're using PV 0.3.0 - I suggest using at least 0.4.0 and ideally the nightly AppImage.
Comment 2 karlp 2018-08-19 00:21:54 CEST
Please learn to read the "git describe" output of your own project.  If you would like the git describe output to be intuitive to you, please consider a different approach to tags.
Comment 3 Uwe Hermann 2018-08-21 12:47:37 CEST
Can you please provide a list of steps to reproduce? I tried to reproduce via random things I could think of with missing firmware/bitstream files, removing them while PV is running (or before it's started), etc. etc. On my setup I was only getting errors in all cases (no segfaults), though.

In most cases I couldn't change the voltage threshold at all actually, since PV will show an error and the logic16 is not being selected in the device drop-down, thus the voltage threshold can't be changed via the UI.

Are there any non-standard settings on your distro maybe? E.g. is Qt or glib built in a way so that every assert() in any of those libs leads to the application being killed (instead of just printing a warning or such)? Just a random guess.
Comment 4 karlp 2018-08-21 13:19:30 CEST
Sure, reproduce steps:

(I can make a video if this doesn't help, it'ðs a little hard to describe gui actions in text sometimes)

1. Make sure one of the bitstreams are missing.

karlp@beros:~/.local/share/sigrok-firmware$ mv saleae-logic16-fpga-33.bitstream nothere/
karlp@beros:~/.local/share/sigrok-firmware$ ls
nothere  saleae-logic16-fpga-18.bitstream  saleae-logic16-fx2.fw
karlp@beros:~/.local/share/sigrok-firmware$ ls nothere/
saleae-logic16-fpga-33.bitstream
karlp@beros:~/.local/share/sigrok-firmware$


2. start PV
3. Run an aquisition, no problems.  (logic 16 is autoselected in dropdown)
4. Click options beside device drop down
5. Select voltage threshold L<1.4V, H>3.6V setting (the "other" setting)
6. Run acquisition.
7. popup says, "Capture failed  generic/unspecified error"
8. after pressing ok, window closes and 

karlp@beros:~/.local/share/sigrok-firmware$ pulseview -l 5
sr: [00:00.000000] log: libsigrok loglevel set to 5.
srd: libsigrokdecode loglevel set to 5.
Segmentation fault (core dumped)
karlp@beros:~/.local/share/sigrok-firmware$

backtrace from above.


To the best of my knowledge, my system is vanilla fedora 27.  I've only installed qt and glib packages, no source installs.  (I've no need for them)


I'm afraid I can't get any log output that might explain these steps as that's inside PV, which has crashed at this point.
Comment 5 Uwe Hermann 2018-08-21 14:35:37 CEST
Alright, the difference seems to be that for me I don't get a crash after the popup.

You can get more info like this:

 $ LD_LIBRARY_PATH=$HOME/sr/lib ~/sr/bin/pulseview -c -l 5 -s

(-l 5 for max log level, -s so that log messages end up on stderr/stdout instead of PV's log window)

sr: [00:10.255246] session: Starting.
sr: [00:10.255264] hwdriver: saleae-logic16: Starting acquisition.
sr: [00:10.255327] saleae-logic16: Uploading FPGA bitstream 'saleae-logic16-fpga-33.bitstream'.
sr: [00:10.255373] resource: SIGROK_FIRMWARE_DIR environment variable not set, ignoring.
sr: [00:10.255493] resource: Attempt to open '/home/uwe/.local/share/sigrok-firmware/saleae-logic16-fpga-33.bitstream' failed: No such file or directory
sr: [00:10.255529] resource: Attempt to open '/home/uwe/sr/share/sigrok-firmware/saleae-logic16-fpga-33.bitstream' failed: No such file or directory
sr: [00:10.255558] resource: Attempt to open '/usr/local/share/sigrok-firmware/saleae-logic16-fpga-33.bitstream' failed: No such file or directory
sr: [00:10.255586] resource: Attempt to open '/usr/share/sigrok-firmware/saleae-logic16-fpga-33.bitstream' failed: No such file or directory
sr: [00:10.255608] resource: Failed to locate 'saleae-logic16-fpga-33.bitstream'.
sr: [00:10.255625] resource: Failed to open resource 'saleae-logic16-fpga-33.bitstream' (use loglevel 5/spew for details).
sr: [00:10.255643] session: Could not start saleae-logic16 device usb/2-3 acquisition.
sr: [00:10.255661] hwdriver: saleae-logic16: Stopping acquisition.
Notifying user of session error: "generic/unspecified error"


Weirdly, one time I've also seen this in the output, at the very end (but not upon every run):

QBackingStore::endPaint() called with active painter on backingstore paint device
Comment 6 karlp 2018-08-21 22:34:54 CEST
attached is the -s -l 5 output, I didn't have before.  It's not _entirely_ the same as in #1263


<< snipped a successful run with the default voltage threshold....>
sr: [00:34.225076] session: Creating our own main context.
sr: [00:34.225103] session: Starting.
sr: [00:34.225121] hwdriver: saleae-logic16: Starting acquisition.
sr: [00:34.225138] saleae-logic16: Uploading FPGA bitstream 'saleae-logic16-fpga-33.bitstream'.
sr: [00:34.225154] resource: SIGROK_FIRMWARE_DIR environment variable not set, ignoring.
sr: [00:34.225220] resource: Attempt to open '/home/karlp/.local/share/sigrok-firmware/saleae-logic16-fpga-33.bitstream' failed: No such file or directory
sr: [00:34.225247] resource: Attempt to open '/home/karlp/.local/share/sigrok-firmware/saleae-logic16-fpga-33.bitstream' failed: No such file or directory
sr: [00:34.225266] resource: Attempt to open '/home/karlp/.local/share/flatpak/exports/share/sigrok-firmware/saleae-logic16-fpga-33.bitstream' failed: No such file or directory
sr: [00:34.225287] resource: Attempt to open '/var/lib/flatpak/exports/share/sigrok-firmware/saleae-logic16-fpga-33.bitstream' failed: No such file or directory
sr: [00:34.225311] resource: Attempt to open '/usr/local/share/sigrok-firmware/saleae-logic16-fpga-33.bitstream' failed: No such file or directory
sr: [00:34.225343] resource: Attempt to open '/usr/share/sigrok-firmware/saleae-logic16-fpga-33.bitstream' failed: No such file or directory
sr: [00:34.225362] resource: Failed to locate 'saleae-logic16-fpga-33.bitstream'.
sr: [00:34.225375] resource: Failed to open resource 'saleae-logic16-fpga-33.bitstream' (use loglevel 5/spew for details).
sr: [00:34.225397] session: Could not start saleae-logic16 device usb/1-5.1.4 acquisition.
sr: [00:34.225437] hwdriver: saleae-logic16: Stopping acquisition.
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Adwaita::WidgetStateEngine(0x1c77dc0), parent's thread is QThread(0x1bd0180), current thread is QThread(0x7f6fdc0013b0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Adwaita::WidgetStateEngine(0x7f7008001620), parent's thread is QThread(0x1bd0180), current thread is QThread(0x7f6fdc0013b0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Adwaita::WidgetStateEngine(0x7f7008001620), parent's thread is QThread(0x1bd0180), current thread is QThread(0x7f6fdc0013b0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Adwaita::WidgetStateEngine(0x1c77dc0), parent's thread is QThread(0x1bd0180), current thread is QThread(0x7f6fdc0013b0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Adwaita::WidgetStateEngine(0x1c77dc0), parent's thread is QThread(0x1bd0180), current thread is QThread(0x7f6fdc0013b0)
QObject::installEventFilter(): Cannot filter events for objects in a different thread.
QObject::installEventFilter(): Cannot filter events for objects in a different thread.
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Adwaita::WidgetStateEngine(0x1c77dc0), parent's thread is QThread(0x1bd0180), current thread is QThread(0x7f6fdc0013b0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Adwaita::WidgetStateEngine(0x1c77dc0), parent's thread is QThread(0x1bd0180), current thread is QThread(0x7f6fdc0013b0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Adwaita::WidgetStateEngine(0x1c77dc0), parent's thread is QThread(0x1bd0180), current thread is QThread(0x7f6fdc0013b0)
QBackingStore::endPaint() called with active painter on backingstore paint device
Segmentation fault (core dumped)
Comment 7 Soeren Apel 2018-08-31 08:04:37 CEST
Does the problem still occur if you uninstall adwaita-qt or follow the steps listed under "If you have seg-faults with QT apps please do this" on https://github.com/manjaro/release-plan/issues/73 ?

To me, this looks like a bug somewhere in the Qt/Adwaita/glib realm.