After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758451 - Segfault at start
Segfault at start
Status: RESOLVED FIXED
Product: sound-juicer
Classification: Applications
Component: general
3.18.x
Other Linux
: Normal critical
: ---
Assigned To: Sound Juicer Maintainers
Sound Juicer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-11-21 11:47 UTC by Salamandar
Modified: 2015-11-23 20:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
genres: Fix crasher with empty genres file (1.08 KB, patch)
2015-11-21 16:28 UTC, Bastien Nocera
committed Details | Review

Description Salamandar 2015-11-21 11:47:43 UTC
At start (with any args but --help), I got a segfault :
$ sound-juicer 
[1]    25839 segmentation fault (core dumped)  sound-juicer


GDB gives me :

(gdb) run
Starting program: /usr/bin/sound-juicer 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe64a4700 (LWP 26832)]
[New Thread 0x7fffe5ca3700 (LWP 26833)]
[New Thread 0x7fffe5285700 (LWP 26835)]
[New Thread 0x7fffe4a84700 (LWP 26861)]
[New Thread 0x7fffd7fff700 (LWP 26862)]
[Thread 0x7fffe5285700 (LWP 26835) exited]
[New Thread 0x7fffe5285700 (LWP 26867)]
[Thread 0x7fffe4a84700 (LWP 26861) exited]
[New Thread 0x7fffe4a84700 (LWP 26871)]
[New Thread 0x7fffd6fc7700 (LWP 26872)]

Program received signal SIGSEGV, Segmentation fault.
0x000000000041ac2b in ?? ()
(gdb) bt
  • #0 ??
  • #1 setup_genre_entry
  • #2 ??
  • #3 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #4 ??
    from /usr/lib/libgobject-2.0.so.0
  • #5 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #6 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #7 g_application_register
    from /usr/lib/libgio-2.0.so.0
  • #8 ??
    from /usr/lib/libgio-2.0.so.0
  • #9 g_application_run
    from /usr/lib/libgio-2.0.so.0
  • #10 main

Any idea ?
Comment 1 Salamandar 2015-11-21 11:48:38 UTC
I tried to build from git/master too… Not better :/
Comment 2 Salamandar 2015-11-21 12:34:56 UTC
Here are an extended gdb output :

  • #0 saved_genres
    at src/sj-genres.c line 87
  • #1 create_genre_list
    at src/sj-genres.c line 111
  • #2 setup_genre_entry
    at src/sj-genres.c line 137
  • #3 startup_cb
    at src/sj-main.c line 2380
  • #4 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #5 ??
    from /usr/lib/libgobject-2.0.so.0
  • #6 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #7 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #8 g_application_register
    from /usr/lib/libgio-2.0.so.0
  • #9 ??
    from /usr/lib/libgio-2.0.so.0
  • #10 g_application_run
    from /usr/lib/libgio-2.0.so.0
  • #11 main
    at src/sj-main.c line 2610

Comment 3 Bastien Nocera 2015-11-21 15:31:24 UTC
Can you attach the ~/.config/sound-juicer/genres file?

I think the crash happens because the split strings is empty, and we're doing strlen on the -1 index of the array, or the string is NULL.
Comment 4 Salamandar 2015-11-21 15:34:02 UTC
It was an empty file. So i deleted the .config/sound-juicer directory. Now it starts with no problems.

You should check if the file is empty ;)
Comment 5 Bastien Nocera 2015-11-21 16:28:39 UTC
Created attachment 316023 [details] [review]
genres: Fix crasher with empty genres file

If g_strv_length() is 0, we'd then try to access the strv at index -1
which is obviously not a good thing to do.
Comment 6 Phillip Wood 2015-11-23 18:21:49 UTC
Review of attachment 316023 [details] [review]:

Looks good, thanks
Comment 7 Bastien Nocera 2015-11-23 20:10:06 UTC
Attachment 316023 [details] pushed as 7cf1def - genres: Fix crasher with empty genres file