ayyi / samplecat

SampleCat is a a program for cataloguing and auditioning audio samples.
http://ayyi.github.io/samplecat/
GNU General Public License v3.0
54 stars 5 forks source link

segfault when running samplecat (0.3.0) #48

Closed simonvanderveldt closed 4 years ago

simonvanderveldt commented 4 years ago

After building samplecat from the 0.3.0 tarball I get a segfault when running it

GDB output below:

gdb ./src/samplecat 
GNU gdb (Gentoo 8.3 vanilla) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./src/samplecat...
(gdb) run
Starting program: /home/simon/Downloads/samplecat-0.3.0/src/samplecat 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Samplecat 0.3.0
warning: GError set over the top of a previous GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
The overwriting error message was: Key file does not have key “window_height” in group “Samplecat”
[New Thread 0x7fffee283700 (LWP 625)]
[New Thread 0x7fffeda82700 (LWP 626)]
log_handler(): level=128 _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
[New Thread 0x7fffed281700 (LWP 627)]
[New Thread 0x7fffdcd61700 (LWP 629)]
[New Thread 0x7fffd7fff700 (LWP 630)]
[New Thread 0x7fffd77fe700 (LWP 631)]
[New Thread 0x7fffd6ffd700 (LWP 632)]
[New Thread 0x7fffd67fc700 (LWP 633)]
[New Thread 0x7fffd5ffb700 (LWP 634)]
[New Thread 0x7fffd57fa700 (LWP 635)]
[New Thread 0x7fffd4ff9700 (LWP 636)]

Thread 1 "samplecat" received signal SIGSEGV, Segmentation fault.
0x000055555558d605 in listview__get_first_selected_iter (iter=iter@entry=0x7fffffffd810) at listview.c:419
419     GtkTreeSelection* selection = gtk_tree_view_get_selection((GtkTreeView*)app->libraryview->widget);
(gdb) thread apply all bt

Thread 12 (Thread 0x7fffd4ff9700 (LWP 636)):
#0  0x00007ffff3f790ec in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fffdf7e6a0b in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007fffdf7e65f7 in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007ffff3f72448 in start_thread () at /lib64/libpthread.so.0
#4  0x00007ffff3ea164f in clone () at /lib64/libc.so.6

Thread 11 (Thread 0x7fffd57fa700 (LWP 635)):
#0  0x00007ffff3f790ec in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fffdf7e6a0b in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007fffdf7e65f7 in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007ffff3f72448 in start_thread () at /lib64/libpthread.so.0
#4  0x00007ffff3ea164f in clone () at /lib64/libc.so.6

Thread 10 (Thread 0x7fffd5ffb700 (LWP 634)):
#0  0x00007ffff3f790ec in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fffdf7e6a0b in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007fffdf7e65f7 in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007ffff3f72448 in start_thread () at /lib64/libpthread.so.0
#4  0x00007ffff3ea164f in clone () at /lib64/libc.so.6

Thread 9 (Thread 0x7fffd67fc700 (LWP 633)):
#0  0x00007ffff3f790ec in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fffdf7e6a0b in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007fffdf7e65f7 in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007ffff3f72448 in start_thread () at /lib64/libpthread.so.0
#4  0x00007ffff3ea164f in clone () at /lib64/libc.so.6

Thread 8 (Thread 0x7fffd6ffd700 (LWP 632)):
#0  0x00007ffff3f790ec in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fffdf7e6a0b in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007fffdf7e65f7 in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007ffff3f72448 in start_thread () at /lib64/libpthread.so.0
#4  0x00007ffff3ea164f in clone () at /lib64/libc.so.6

Thread 7 (Thread 0x7fffd77fe700 (LWP 631)):
#0  0x00007ffff3f790ec in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fffdf7e6a0b in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007fffdf7e65f7 in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007ffff3f72448 in start_thread () at /lib64/libpthread.so.0
#4  0x00007ffff3ea164f in clone () at /lib64/libc.so.6

Thread 6 (Thread 0x7fffd7fff700 (LWP 630)):
#0  0x00007ffff3f790ec in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fffdf7e6a0b in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007fffdf7e65f7 in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007ffff3f72448 in start_thread () at /lib64/libpthread.so.0
#4  0x00007ffff3ea164f in clone () at /lib64/libc.so.6

Thread 5 (Thread 0x7fffdcd61700 (LWP 629)):
#0  0x00007ffff3f790ec in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fffdf7e6a0b in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007fffdf7e65f7 in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007ffff3f72448 in start_thread () at /lib64/libpthread.so.0
#4  0x00007ffff3ea164f in clone () at /lib64/libc.so.6

Thread 4 (Thread 0x7fffed281700 (LWP 627)):
#0  0x00007ffff3e95633 in poll () at /lib64/libc.so.6
#1  0x00007ffff5d208c9 in  () at /usr/lib64/libglib-2.0.so.0
#2  0x00007ffff5d20c62 in g_main_loop_run () at /usr/lib64/libglib-2.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#3  0x00005555555b2671 in worker_thread (data=<optimized out>) at worker.c:103
#4  0x00007ffff5d4978d in  () at /usr/lib64/libglib-2.0.so.0
#5  0x00007ffff3f72448 in start_thread () at /lib64/libpthread.so.0
#6  0x00007ffff3ea164f in clone () at /lib64/libc.so.6

Thread 3 (Thread 0x7fffeda82700 (LWP 626)):
#0  0x00007ffff3e95633 in poll () at /lib64/libc.so.6
#1  0x00007ffff5d208c9 in  () at /usr/lib64/libglib-2.0.so.0
#2  0x00007ffff5d20c62 in g_main_loop_run () at /usr/lib64/libglib-2.0.so.0
#3  0x00007ffff64d8cf6 in  () at /usr/lib64/libgio-2.0.so.0
#4  0x00007ffff5d4978d in  () at /usr/lib64/libglib-2.0.so.0
#5  0x00007ffff3f72448 in start_thread () at /lib64/libpthread.so.0
#6  0x00007ffff3ea164f in clone () at /lib64/libc.so.6

Thread 2 (Thread 0x7fffee283700 (LWP 625)):
#0  0x00007ffff3e95633 in poll () at /lib64/libc.so.6
#1  0x00007ffff5d208c9 in  () at /usr/lib64/libglib-2.0.so.0
#2  0x00007ffff5d209dc in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#3  0x00007ffff5d20a21 in  () at /usr/lib64/libglib-2.0.so.0
#4  0x00007ffff5d4978d in  () at /usr/lib64/libglib-2.0.so.0
#5  0x00007ffff3f72448 in start_thread () at /lib64/libpthread.so.0
#6  0x00007ffff3ea164f in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7fffef3fb440 (LWP 616)):
#0  0x000055555558d605 in listview__get_first_selected_iter (iter=iter@entry=0x7fffffffd810) at listview.c:419
#1  0x000055555558ea42 in listview__get_first_selected_filepath () at listview.c:503
#2  0x000055555558c7cd in show_spectrogram (enable=enable@entry=1) at window.c:1583
#3  0x000055555558c9cd in _on_layout_changed (object=<optimized out>, user_data=<optimized out>) at window.c:418
#4  0x00007ffff6321c8d in g_closure_invoke () at /usr/lib64/libgobject-2.0.so.0
#5  0x00007ffff633544e in  () at /usr/lib64/libgobject-2.0.so.0
#6  0x00007ffff633db35 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0
#7  0x00007ffff633e557 in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
#8  0x00005555555ba957 in idle_emit_layout_changed (user_data=0x5555560449c0) at gdl-dock-master.c:677
#9  0x00007ffff5d20585 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#10 0x00007ffff5d20950 in  () at /usr/lib64/libglib-2.0.so.0
#11 0x00007ffff5d20c62 in g_main_loop_run () at /usr/lib64/libglib-2.0.so.0
#12 0x00007ffff6b0b707 in gtk_main () at /usr/lib64/libgtk-x11-2.0.so.0
#13 0x0000555555587273 in main (argc=<optimized out>, argv=<optimized out>) at main.c:392
ayyi commented 4 years ago

Thanks for the backtrace. You hit some dodgy old code there, probably referencing a widget that was not instantiated. I am hopeful that the commit mentioned above fixes the problem for you Regards

simonvanderveldt commented 4 years ago

Just tried to build from git but the libwaveform submodule is using a very old commit (this one to be precise https://github.com/ayyi/libwaveform/commit/11b08878daebd3753d5281d18aa305444fc50e2d) causing the build to fail (specifically because waveform/promise.h is missing). I've updated the submodule to current master, which is this commit at the moment https://github.com/ayyi/libwaveform/commit/17b4fe92adad11dd0fa92b969b1890767c7f1d9d. Compilation worked after that. I'm not sure that's the branch that should be used, but the submodule should definitely be updated :)

Anyway, the segfault is gone now :) Thanks for the quick fix! Unfortunately I did run into a bunch of other issues. Should I create separate issues for them?

ayyi commented 4 years ago

Hi

Yes the master branch is the best branch. As it says in the README you do have to do

git submodule foreach git pull origin master

but I don't know why this is needed.

Glad the segfault is fixed. Yes, separate issues per issue - please create as many as you like! Cheers