Subject: Audacious plugin segfaults on quit.

From: Joker
Date: Tue Jul 18 18:22:38 2006

To: UADE-Developer-discussion
I get a segfault of the Audacious plugin sometimes and it always
seems to be in the uade_save_content_db() functions, because
the contentdb is always 0 bytes if this happens.

The problem is it doesn't happen all the time so debuging is really
hard. Also the fact that plugins or the player could corrupt each
other doesn't really make it more simple.

There is a backtrace i could get after running for some time:

[code:1:a68abedb86]
Program received signal SIGSEGV, Segmentation fault.
&#91;Switching to Thread 47807722829104 &#40;LWP 14109&#41;&#93;
0x00002aaaae824292 in vplist_len &#40;v=0x0&#41; at vplist.h&#58;41
41      vplist.h&#58; No such file or directory.
        in vplist.h
&#40;gdb&#41; bt
#0  0x00002aaaae824292 in vplist_len &#40;v=0x0&#41; at vplist.h&#58;41
#1  0x00002aaaae824df1 in uade_save_content_db filename=0x2aaaae934540 &quot;/home/joker/.uade2/contentdb&quot;&#41; at songdb.c&#58;526
#2  0x00002aaaae8153c4 in uade_cleanup &#40;&#41; at plugin.c&#58;187
#3  0x000000000041fc03 in plugin_system_cleanup &#40;&#41; at pluginenum.c&#58;370
#4  0x0000000000436101 in mainwin_quit_cb &#40;&#41; at mainwin.c&#58;698
#5  0x000000000042baf2 in pbutton_button_release_cb widget=0x5d86b0, event=0x293c5a0, button=0x635500&#41; at pbutton.c&#58;88
#6  0x000000000042b32e in handle_release_cb &#40;widget_list=0x5afea8, idget=0x5d86b0, event=0x293c5a0&#41; at widget.c&#58;163
#7  0x0000000000436bc3 in mainwin_mouse_button_release &#40;widget=0x5d86b0, event=0x293c5a0, callback_data=0x0&#41; at mainwin.c&#58;1018
#8  0x00002b7b173c7298 in gtk_marshal_VOID__UINT_STRING &#40;&#41; from /usr/lib64/libgtk-x11-2.0.so.0
#9  0x00002b7b180a3ab9 in g_closure_invoke &#40;&#41; from /usr/lib64/libgobject-2.0.so.0
#10 0x00002b7b180b7044 in g_signal_has_handler_pending &#40;&#41; from /usr/lib64/libgobject-2.0.so.0
#11 0x00002b7b180b8069 in g_signal_emit_valist &#40;&#41; from /usr/lib64/libgobject-2.0.so.0
#12 0x00002b7b180b8673 in g_signal_emit &#40;&#41; from /usr/lib64/libgobject-2.0.so.0
#13 0x00002b7b174aa260 in gtk_widget_activate &#40;&#41; from /usr/lib64/libgtk-x11-2.0.so.0
#14 0x00002b7b173c5651 in gtk_propagate_event &#40;&#41; from /usr/lib64/libgtk-x11-2.0.so.0
#15 0x00002b7b173c599c in gtk_main_do_event &#40;&#41; from /usr/lib64/libgtk-x11-2.0.so.0
#16 0x00002b7b1770b540 in gdk_event_get_graphics_expose &#40;&#41; from /usr/lib64/libgdk-x11-2.0.so.0
#17 0x00002b7b18405486 in g_main_context_dispatch &#40;&#41; from /usr/lib64/libglib-2.0.so.0
#18 0x00002b7b18406ea8 in g_main_context_acquire &#40;&#41; from /usr/lib64/libglib-2.0.so.0
#19 0x00002b7b1840720a in g_main_loop_run &#40;&#41; from /usr/lib64/libglib-2.0.so.0
#20 0x00002b7b173c4e71 in gtk_main &#40;&#41; from /usr/lib64/libgtk-x11-2.0.so.0
#21 0x00000000004357bb in main &#40;argc=1, argv=0x7fff93920a88&#41; at main.c&#58;1136
[/code:1:a68abedb86]

So the &quot;n-&gt;subs&quot; seems to be NULL for some reason in the uade_save_content_db() function.

---

From: Joker
Date: Tue Jul 18 19:13:31 2006

To: UADE-Developer-discussion
Got another one triggered by the &quot;Save current db if an hour has passed&quot;:

[code:1:8412505010]
Program received signal SIGSEGV, Segmentation fault.
&#91;Switching to Thread 47465998693760 &#40;LWP 10002&#41;&#93;
0x00002aaaaeaa5292 in vplist_len &#40;v=0x0&#41; at vplist.h&#58;41
41      vplist.h&#58; No such file or directory.
        in vplist.h
&#40;gdb&#41; bt
#0  0x00002aaaaeaa5292 in vplist_len &#40;v=0x0&#41; at vplist.h&#58;41
#1  0x00002aaaaeaa5df1 in uade_save_content_db &#40;filename=0x2aaaaebb5540 &quot;/home/joker/.uade2/contentdb&quot;&#41; at songdb.c&#58;526
#2  0x00002aaaaea97924 in uade_play_file &#40;filename=0x27ec160 &quot;/home/files/Muzak5/LovingSpiraeas.MOD&quot;&#41; at plugin.c&#58;741
#3  0x000000000043008c in bmp_playback_play_file &#40;entry=0x27ec130&#41; at playback.c&#58;238
#4  0x000000000042fcfe in bmp_playback_initiate &#40;&#41; at playback.c&#58;103
#5  0x0000000000422f29 in playlist_eof_reached &#40;&#41; at playlist.c&#58;1188
#6  0x0000000000415ad4 in idle_func_change_song &#40;waiting=0&#41; at genevent.c&#58;120
#7  0x0000000000415b2f in audcore_generic_events &#40;&#41; at genevent.c&#58;142
#8  0x000000000043ce0c in mainwin_idle_func &#40;data=0x0&#41; at mainwin.c&#58;3446
#9  0x00002b2b87e777fb in g_main_context_is_owner &#40;&#41; from /usr/lib64/libglib-2.0.so.0
#10 0x00002b2b87e74d06 in g_main_context_dispatch &#40;&#41; from /usr/lib64/libglib-2.0.so.0
#11 0x00002b2b87e76728 in g_main_context_acquire &#40;&#41; from /usr/lib64/libglib-2.0.so.0
#12 0x00002b2b87e76a8a in g_main_loop_run &#40;&#41; from /usr/lib64/libglib-2.0.so.0
#13 0x00002b2b86e2e311 in gtk_main &#40;&#41; from /usr/lib64/libgtk-x11-2.0.so.0
#14 0x000000000043588b in main &#40;argc=1, argv=0x7fff23eb8028&#41; at main.c&#58;1136
[/code:1:8412505010]

Btw. &quot;playlist_eof_reached&quot; is a wrong name. The variable only means current object played, get another playlist entry to play next.

---

From: Joker
Date: Tue Jul 18 19:26:52 2006

To: UADE-Developer-discussion
Ah btw. that vplist.h not found message is only from gdb.
It wants to read the file which caused the segfault and tries to open it.
When you have the vplist.h in current dir it writes:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47997597869440 (LWP 10623)]
0x00002aaaaeaa5292 in vplist_len (v=0x0) at vplist.h:41
41        return v-&gt;tail - v-&gt;head;

That's all.

---

From: shd
Date: Thu Jul 20 13:00:56 2006

To: UADE-Developer-discussion
[quote:3197ecc15c="Joker"]Ah btw. that vplist.h not found message is only from gdb.
It wants to read the file which caused the segfault and tries to open it.
When you have the vplist.h in current dir it writes:

That's all.[/quote:3197ecc15c]

Thanks for reporting. Try the newest cvs version. I think I fixed this problem a few days ago.

---

From: shd
Date: Thu Jul 20 13:03:22 2006

To: UADE-Developer-discussion
[quote:a16d1cad0c="Joker"]Btw. &quot;playlist_eof_reached&quot; is a wrong name. The variable only means current object played, get another playlist entry to play next.[/quote:a16d1cad0c]

And that's not our code.

---

From: shd
Date: Thu Jul 20 13:13:40 2006

To: UADE-Developer-discussion
[quote:2d048ae8a4="Joker"]The problem is it doesn't happen all the time so debuging is really hard. Also the fact that plugins or the player could corrupt each other doesn't really make it more simple.
[/quote:2d048ae8a4]

It happens if some new play time was learned.

---

From: Guest
Date: Thu Jul 20 13:44:59 2006

To: UADE-Developer-discussion
[quote:cd0740eb7d="shd"][quote:cd0740eb7d="Joker"]Btw. &quot;playlist_eof_reached&quot; is a wrong name. The variable only means current object played, get another playlist entry to play next.[/quote:cd0740eb7d]

And that's not our code.[/quote:cd0740eb7d]

I know that this was not your code. I just mentioned it that you know
&quot;when&quot; it happens. And that it's not when the end of the playlist is reached
etc.

Anyway, CVS version seems to work without crashing now.
THanks for the fix.