Debug and Stack Tracing

This page will show how to generate a debug build and how to handle core dumps.

Concept:

Build wfview with the debugging symbols intact. This will guide gdb.

If this build of wfview crashes, load up gdb and tell it to generate a stack trace from the core dump file.

Build:

Follow the usual build directions, except, change the qmake step to this:

qmake ../wfview/wfview.pro CONFIG+=debug

You may need to obtain a debug-enabled version of qcustomplot. If this is difficult (it is), just change the wfview.pro file so that instead of “libqcustomplotd” it shows “libqcustomplot”

Install this version of wfview, or keep it uninstalled and run it from this directory. Make sure you have installed the rig files recently though.

Run wfview:

Now run wfview and recreate the crash. Ideally, pass the --debug flag to wfview so that additional logging is created. When wfview crashes, you will see a message like this:

Segmentation fault (core dumped)

View the core:

The core file will likely be in /var/lib/systemd/coredump or in your home directory, depending on how your system is setup.

If the file ends in “zst” you will need to decompress the file first. For example:

zstd -core core.wfview.1000.54c8d1d763e54b76938af40630022cdf.12386.1754757191000000.zst -o /tmp/core.dump

Now launch gdb as shown, with the path to your debug build wfview and core file:

gdb /home/w6el/Downloads/wfview--20250803--1202222/debugbuild/wfview /tmp/core.dump

You will see:

Reading symbols from /home/eliggett/Downloads/wfview--20250809--08-37-25/debug3/wfview...

You may need to hit enter to complete the initial text output.

Now issue the “bt” command to show the backtrace:

--Type <RET> for more, q to quit, c to continue without paging--
[Current thread is 1 (Thread 0x7ff2f100d640 (LWP 12412))]
(gdb) bt
#0 0x00007ff33e9e2f5e in snd_pcm_avail_update () at /lib/x86_64-linux-gnu/libasound.so.2
#1 0x00007ff33804c6ac in () at /usr/lib/x86_64-linux-gnu/qt5/plugins/audio/libqtaudio_alsa.so
#2 0x00005625c0bfd1b6 in audioHandler::convertedOutput(audioPacket) (this=0x7ff2c8005c90, packet=...) at ../wfview/audiohandler.cpp:312
#3 0x00005625c0d5a22e in audioHandler::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
(_o=0x7ff2c8005c90, _c=QMetaObject::InvokeMetaMethod, _id=11, _a=0x7ff2c001f188) at moc_audiohandler.cpp:165
#4 0x00007ff33f2d341e in QObject::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#5 0x00007ff33fff3713 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#6 0x00007ff33f2a5e3a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#7 0x00007ff33f2a8f27 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#8 0x00007ff33f2ffa67 in () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#9 0x00007ff33dedbd3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ff33df312b8 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ff33ded93e3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ff33f2ff112 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
at /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ff33804dda3 in () at /usr/lib/x86_64-linux-gnu/qt5/plugins/audio/libqtaudio_alsa.so
#14 0x00007ff33804de1d in () at /usr/lib/x86_64-linux-gnu/qt5/plugins/audio/libqtaudio_alsa.so
#15 0x00007ff3405ad605 in QAudioOutput::~QAudioOutput() () at /lib/x86_64-linux-gnu/libQt5Multimedia.so.5
#16 0x00007ff3405ad61d in QAudioOutput::~QAudioOutput() () at /lib/x86_64-linux-gnu/libQt5Multimedia.so.5
#17 0x00005625c0bfb274 in audioHandler::~audioHandler() (this=0x7ff2c8005c90, __in_chrg=<optimized out>) at ../wfview/audiohandler.cpp:35
#18 0x00005625c0bfb316 in audioHandler::~audioHandler() (this=0x7ff2c8005c90, __in_chrg=<optimized out>) at ../wfview/audiohandler.cpp:39
#19 0x00007ff33f2d31c3 in QObject::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007ff33fff3713 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ff33f2a5e3a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007ff33f2a8f27 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007ff33f0b8389 in () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007ff33f0b8ca9 in () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007ff33eb22ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#26 0x00007ff33ebb4850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb)