Redmine: Issueshttp://redmine.audacious-media-player.org/http://redmine.audacious-media-player.org/welcome/favicon.ico?15159353402018-08-09T03:09:50ZRedmine
Redmine Audacious - Feature #818 (Rejected): More efficient SongTuple D-Bus methodhttp://redmine.audacious-media-player.org/issues/8182018-08-09T03:09:50ZTom Thorogood
<p>I'm working on <a href="https://github.com/tmthrgd/spork" class="external">a project</a> that uses the <code>org.atheme.audacious</code> D-Bus interface. In order to retrieve multiple song fields, multiple separate <code>org.atheme.audacious.SongTuple</code> D-Bus requests have to be made, and this quickly becomes inefficient and slow for large playlists. I'd like to propose a new D-Bus method be added:</p>
<pre>
<!-- Get the value of multiple tuple fields of some song -->
<method name="SongTuples">
<!-- Song position in the playlist -->
<arg type="u" direction="in" name="pos"/>
<!-- Array of tuple names -->
<arg type="as" direction="in" name="tuples"/>
<!-- Return array of tuple values -->
<arg type="av" direction="out" name="values"/>
</method>
</pre>
<p>This would allow a single request to be made per-song, rather than N for N-fields. The return values would be indexed in the same order as the tuple names.</p> Audacious - Bug #817 (Closed): Crash on invalid tuple D-Bus requesthttp://redmine.audacious-media-player.org/issues/8172018-08-09T02:31:06ZTom Thorogood
<p>I was able to trigger an easily reproducible crash through the D-Bus interface. The <code>org.atheme.audacious.SongTuple</code> method does not valid the requested tuple in <a href="https://github.com/audacious-media-player/audacious/blob/cdcc92f29f4834f3bdd51b1894b995a585efaf12/src/audacious/dbus-server.cc#L635" class="external"><code>do_song_tuple</code></a> before calling <code>get_value_type</code>. This triggers an <code>assert</code> in <code>get_value_type</code>, but could potentially still crash otherwise. Instead of a crash, I'd expect either an empty string or an error to be returned.</p>
<p>The crash can be reproduced with:<br /><pre>
dbus-send --session --print-reply --dest=org.atheme.audacious /org/atheme/audacious org.atheme.audacious.SongTuple uint32:0 string:x
</pre></p>
<p>It crashes with the following backtrace:<br /><pre>
#0 0x00007ffff638afeb in raise () at /lib64/libc.so.6
#1 0x00007ffff63755c1 in abort () at /lib64/libc.so.6
#2 0x00007ffff6375491 in _nl_load_domain.cold.0 () at /lib64/libc.so.6
#3 0x00007ffff6383752 in () at /lib64/libc.so.6
#4 0x00007ffff7bb1d26 in Tuple::get_value_type(Tuple::Field) const (this=this@entry=0x7fffffffc970, field=field@entry=Tuple::Invalid) at tuple.cc:450
#5 0x000055555555f66d in do_song_tuple(_ObjAudacious*, _GDBusMethodInvocation*, unsigned int, char const*) (obj=0x5555557a4ce0, invoc=0x555555cf3260, pos=0, key=<optimized out>)
at dbus-server.cc:644
#6 0x00007ffff5a6e03e in ffi_call_unix64 () at /lib64/libffi.so.6
#7 0x00007ffff5a6d9ff in ffi_call () at /lib64/libffi.so.6
#8 0x00007ffff73795a5 in g_cclosure_marshal_generic () at /lib64/libgobject-2.0.so.0
#9 0x00007ffff7378add in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#10 0x00007ffff738bf43 in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
#11 0x00007ffff739419f in g_signal_emitv () at /lib64/libgobject-2.0.so.0
#12 0x000055555556a01a in _obj_audacious_skeleton_handle_method_call (connection=<optimized out>, sender=<optimized out>, object_path=<optimized out>, interface_name=0x7fffd4018f80 "org.atheme.audacious", method_name=0x7fffd40193a0 "SongTuple", parameters=<optimized out>, invocation=0x555555cf3260, user_data=0x5555557a4ce0) at aud-dbus.c:15178
#13 0x00007ffff76970f6 in g_dbus_interface_method_dispatch_helper () at /lib64/libgio-2.0.so.0
#14 0x00007ffff767eb50 in call_in_idle_cb () at /lib64/libgio-2.0.so.0
#15 0x00007ffff709a1cb in g_idle_dispatch () at /lib64/libglib-2.0.so.0
#16 0x00007ffff709d8ad in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#17 0x00007ffff709dc78 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#18 0x00007ffff709dfa2 in g_main_loop_run () at /lib64/libglib-2.0.so.0
#19 0x00007fffcd32695f in gtk_main () at /lib64/libgtk-x11-2.0.so.0
#20 0x00007ffff7b9c85e in interface_run() () at interface.cc:163
#21 0x00007ffff7baffd6 in aud_run() () at runtime.cc:323
#22 0x000055555555e774 in main (argc=<optimized out>, argv=<optimized out>) at main.cc:395
#23 0x00007ffff637724b in __libc_start_main () at /lib64/libc.so.6
#24 0x000055555555ed7a in _start () at main.cc:410
</pre></p>
<p>I'm running into this with Audacious 3.10-beta1 (from <a class="external" href="https://copr.fedorainfracloud.org/coprs/mschwendt/audacious-next/">https://copr.fedorainfracloud.org/coprs/mschwendt/audacious-next/</a>).</p> Audacious - Bug #806 (Closed): Deadlock when updating song infohttp://redmine.audacious-media-player.org/issues/8062018-07-10T11:18:58ZTom Thorogood
<p>I'm running into a deadlock pretty consistently when clicking Save in the Song Info window. It happens about half the time and may occur the first time the window is opened or later.</p>
<p>To reproduce, I:<br />- add a new mp3 to my playlist,<br />- open the Song Info window,<br />- fill in the info,<br />- press Save.</p>
<p>I was able to capture the following backtrace running under gdb:<br /><pre>
Thread 49 (Thread 0x7fff9702b700 (LWP 12328)):
#0 0x00007ffff79707fd in __lll_lock_wait () at /lib64/libpthread.so.0
#1 0x00007ffff7969cf4 in pthread_mutex_lock () at /lib64/libpthread.so.0
#2 0x00007ffff7b9f8c9 in output_set_tuple(Tuple const&) (tuple=...) at output.cc:452
#3 0x00007ffff7ba14b3 in playback_set_info(int, Tuple&&) (entry=0, tuple=...) at playback.cc:155
#4 0x00007ffff7ba318e in pl_signal_update_queued(Playlist::ID*, Playlist::UpdateLevel, int) (id=<optimized out>, level=Playlist::Metadata, flags=2) at playlist.cc:542
#5 0x00007ffff7ba8368 in PlaylistData::update_entry_from_scan(PlaylistEntry*, ScanRequest*, int) (this=0x55555583b5e0, entry=0x5555559ce2d0, request=0x555555c88660, update_flags=2) at playlist-data.cc:1019
#6 0x00007ffff7ba2bef in scan_finish(ScanRequest*) (request=0x555555c88660) at playlist.cc:420
#7 0x00007ffff7bb0bfa in ScanRequest::run() (this=0x555555c88660) at scanner.cc:108
#8 0x00007ffff7bb0d92 in scan_worker(void*, void*) (data=0x555555c88660) at scanner.cc:113
#9 0x00007ffff70c7933 in g_thread_pool_thread_proxy () at /lib64/libglib-2.0.so.0
#10 0x00007ffff70c6f2a in g_thread_proxy () at /lib64/libglib-2.0.so.0
#11 0x00007ffff7967594 in start_thread () at /lib64/libpthread.so.0
#12 0x00007ffff644f02f in clone () at /lib64/libc.so.6
Thread 48 (Thread 0x7fffae8d0700 (LWP 12280)):
#0 0x00007ffff64445a9 in poll () at /lib64/libc.so.6
#1 0x00007fffe23cb016 in pump(void*) () at /usr/lib64/audacious/Output/alsa.so
#2 0x00007ffff7967594 in start_thread () at /lib64/libpthread.so.0
#3 0x00007ffff644f02f in clone () at /lib64/libc.so.6
Thread 47 (Thread 0x7fffaf2d5700 (LWP 12279)):
#0 0x00007ffff64445a9 in poll () at /lib64/libc.so.6
#1 0x00007fffe1ca0d75 in () at /lib64/libpulse.so.0
#2 0x00007fffe1c92368 in pa_mainloop_poll () at /lib64/libpulse.so.0
#3 0x00007fffe1c929b2 in pa_mainloop_iterate () at /lib64/libpulse.so.0
#4 0x00007fffe1c92a60 in pa_mainloop_run () at /lib64/libpulse.so.0
#5 0x00007fffe1ca0cbd in () at /lib64/libpulse.so.0
#6 0x00007fffe1a3f98c in () at /usr/lib64/pulseaudio/libpulsecommon-11.1.so
#7 0x00007ffff7967594 in start_thread () at /lib64/libpthread.so.0
#8 0x00007ffff644f02f in clone () at /lib64/libc.so.6
Thread 7 (Thread 0x7fffce8a7700 (LWP 5480)):
#0 0x00007ffff796d52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1 0x00007fffe23cae34 in ALSAPlugin::period_wait() () at /usr/lib64/audacious/Output/alsa.so
#2 0x00007ffff7b9ed25 in write_output(Index<float>&) (data=...) at output.cc:362
#3 0x00007ffff7b9fe4a in output_write_audio(void const*, int, int) (data=data@entry=0x7fffce8a2bf0, size=size@entry=16384, stop_time=<optimized out>) at output.cc:402
#4 0x00007ffff7ba194f in InputPlugin::write_audio(void const*, int) (data=0x7fffce8a2bf0, length=16384) at playback.cc:548
#5 0x00007fffcdca16ba in MPG123Plugin::play(char const*, VFSFile&) () at /usr/lib64/audacious/Input/madplug.so
#6 0x00007ffff7ba0e14 in run_playback () at ../libaudcore/objects.h:194
#7 0x00007ffff7ba0e14 in playback_thread(void*) () at playback.cc:401
#8 0x00007ffff7967594 in start_thread () at /lib64/libpthread.so.0
#9 0x00007ffff644f02f in clone () at /lib64/libc.so.6
Thread 6 (Thread 0x7fffcf2ac700 (LWP 5479)):
#0 0x00007ffff64445a9 in poll () at /lib64/libc.so.6
#1 0x00007fffe1ca0d75 in () at /lib64/libpulse.so.0
#2 0x00007fffe1c92368 in pa_mainloop_poll () at /lib64/libpulse.so.0
#3 0x00007fffe1c929b2 in pa_mainloop_iterate () at /lib64/libpulse.so.0
#4 0x00007fffe1c92a60 in pa_mainloop_run () at /lib64/libpulse.so.0
#5 0x00007fffe1ca0cbd in () at /lib64/libpulse.so.0
#6 0x00007fffe1a3f98c in () at /usr/lib64/pulseaudio/libpulsecommon-11.1.so
#7 0x00007ffff7967594 in start_thread () at /lib64/libpthread.so.0
#8 0x00007ffff644f02f in clone () at /lib64/libc.so.6
Thread 5 (Thread 0x7fffe2dd1700 (LWP 5478)):
#0 0x00007ffff638cccc in sigtimedwait () at /lib64/libc.so.6
#1 0x00007ffff7971b4c in sigwait () at /lib64/libpthread.so.0
#2 0x000055555555ee1b in signal_thread(void*) (data=<optimized out>) at signals.cc:35
#3 0x00007ffff7967594 in start_thread () at /lib64/libpthread.so.0
#4 0x00007ffff644f02f in clone () at /lib64/libc.so.6
Thread 3 (Thread 0x7fffe3dd3700 (LWP 5476)):
#0 0x00007ffff64445a9 in poll () at /lib64/libc.so.6
#1 0x00007ffff709ebe6 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#2 0x00007ffff709efa2 in g_main_loop_run () at /lib64/libglib-2.0.so.0
#3 0x00007ffff768f6ba in gdbus_shared_thread_func () at /lib64/libgio-2.0.so.0
#4 0x00007ffff70c6f2a in g_thread_proxy () at /lib64/libglib-2.0.so.0
#5 0x00007ffff7967594 in start_thread () at /lib64/libpthread.so.0
#6 0x00007ffff644f02f in clone () at /lib64/libc.so.6
Thread 2 (Thread 0x7fffe45d4700 (LWP 5475)):
#0 0x00007ffff64445a9 in poll () at /lib64/libc.so.6
#1 0x00007ffff709ebe6 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#2 0x00007ffff709ed10 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#3 0x00007ffff709ed61 in glib_worker_main () at /lib64/libglib-2.0.so.0
#4 0x00007ffff70c6f2a in g_thread_proxy () at /lib64/libglib-2.0.so.0
#5 0x00007ffff7967594 in start_thread () at /lib64/libpthread.so.0
#6 0x00007ffff644f02f in clone () at /lib64/libc.so.6
Thread 1 (Thread 0x7ffff7fbd940 (LWP 5462)):
#0 0x00007ffff79707fd in __lll_lock_wait () at /lib64/libpthread.so.0
#1 0x00007ffff7969cf4 in pthread_mutex_lock () at /lib64/libpthread.so.0
#2 0x00007ffff7ba1bc1 in lock () at playback.cc:627
#3 0x00007ffff7ba1bc1 in aud_drct_get_playing() () at playback.cc:627
#4 0x00007fffacc199d0 in update(void*) () at /usr/lib64/audacious/General/mpris2.so
#5 0x00007ffff7bb17c5 in timer_run(void*) (list_=0x7ffff7dd5920 <lists+32>) at timer.cc:87
#6 0x00007ffff7b9dc83 in QueuedFuncHelper::run() (this=0x555555a64fc0) at mainloop.cc:136
#7 0x00007ffff7b9dcad in QueuedFuncHelper::<lambda(void*)>::operator() (__closure=0x0, me=0x7ffff7dd5440 <_ZL5mutex>) at mainloop.cc:152
#8 0x00007ffff7b9dcad in QueuedFuncHelper::<lambda(void*)>::_FUN(void *) () at mainloop.cc:154
#9 0x00007ffff709f371 in g_timeout_dispatch () at /lib64/libglib-2.0.so.0
#10 0x00007ffff709e8ad in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#11 0x00007ffff709ec78 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#12 0x00007ffff709efa2 in g_main_loop_run () at /lib64/libglib-2.0.so.0
#13 0x00007fffcccb595f in gtk_main () at /lib64/libgtk-x11-2.0.so.0
#14 0x00007ffff7b9d30e in interface_run() () at interface.cc:163
#15 0x00007ffff7bb0716 in aud_run() () at runtime.cc:323
#16 0x000055555555e424 in main (argc=<optimized out>, argv=<optimized out>) at main.cc:395
#17 0x00007ffff637818b in __libc_start_main () at /lib64/libc.so.6
#18 0x000055555555ea5a in _start () at main.cc:410
</pre></p>
<p>I'm not familiar with the audacious codebase and couldn't figure out what's causing this, but I'm pretty sure it's deadlocking on a mutex or something similar. (There is no abnormal CPU usage suggesting any sort of infinite loop).</p>
<p>The audio output plug-in is ALSA Output, ReplayGain is enabled, and the following plugins are enabled:<br />- Audio CD Menu Items,<br />- Desktop Notifications,<br />- MPRIS 2 Server,<br />- ModPlug (Module Player),<br />- MPG123 Plugin,<br />- Tact Generator,<br />- Tone Generator,<br />- WavPack Decoder,<br />- FLAC Decoder,<br />- Ogg Vorbis Decoder,<br />- Sndfile Plugin,<br />- ASXv1/ASXv2 Playlists,<br />- ASXv3 Playlists,<br />- Audacious Playlists (audpl),<br />- Cue Sheet Plugin,<br />- M3U Playlists,<br />- PLS Playlists,<br />- XML ShHareable Playlists (XSPF),<br />- GIO Plugin,<br />- Neon HTTP/HTTPS Plugin.</p>
<p>I'm running this on Fedora 28 (but I'm pretty sure I had the same problem under 27). The versions I have installed are:<br /><pre>
audacious.x86_64 3.9-3.fc28 @fedora
audacious-debuginfo.x86_64 3.9-3.fc28 @fedora-debuginfo
audacious-debugsource.x86_64 3.9-3.fc28 @fedora-debuginfo
audacious-libs.x86_64 3.9-3.fc28 @fedora
audacious-libs-debuginfo.x86_64 3.9-3.fc28 @fedora-debuginfo
audacious-plugins.x86_64 3.9-6.fc28 @fedora
audacious-plugins-debuginfo.x86_64 3.9-6.fc28 @fedora-debuginfo
audacious-plugins-debugsource.x86_64 3.9-6.fc28 @fedora-debuginfo
</pre></p>