[vlc-devel] [bug]is this a bug in RC? "pause" cause crash!
Andy chenee
chenee543216 at gmail.com
Tue Aug 11 16:45:40 CEST 2009
hi all:
1) When I play a media file with vlc like "./vlc -I rc /tmp/1.mp4", then
type "pause" in cmdline,every time, the vlc crashed!
git version: 592f40d6b0c6010051d8867a791301cb90dbc760
uname -a :Linux home 2.6.28-14-generic #46-Ubuntu SMP Wed Jul 8 07:21:34 UTC
2009 i686 GNU/Linux
error output:
--------
pause
LibVLC fatal error locking mutex (35) in thread 5518 at misc/pthread.c:215
in vlc_mutex_lock
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f8604e]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f860db]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(vlc_mutex_lock+0x57)[0xb7f86301]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(playlist_Lock+0x22)[0xb7f040bc]
/home/chenee/workstation/vlc/modules/control/.libs/librc_plugin.so[0xb7b15fad]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f81f1c]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(var_SetChecked+0x13b)[0xb7f809a0]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f0466e]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f04489]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(playlist_Control+0x47)[0xb7f04159]
/home/chenee/workstation/vlc/modules/control/.libs/librc_plugin.so[0xb7b1626a]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f81f1c]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(var_SetChecked+0x13b)[0xb7f809a0]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(__var_Set+0x3a)[0xb7f80a0b]
/home/chenee/workstation/vlc/modules/control/.libs/librc_plugin.so[0xb7b14527]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f0198f]
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f7157a]
/lib/tls/i686/cmov/libpthread.so.0[0xb7eb24ff]
/lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb7e2d49e]
Error message: Resource deadlock avoided
Aborted
--------------
2) I debug the vlc and found that:
When type "pause",it first call "playlist_Pause( p_intf->p_sys->p_playlist
);"to lock the playlist mutex,
But when var "state" changed, the callback function "StateChanged(xxx)" in
rc.c will re-call PL_LOCK;
so, it crashed.
3) I use a local static variable to avoid it crash temporarily, expect
better solutions!
------------
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -959,6 +959,7 @@ static int VolumeChanged( vlc_object_t *p_this, char
const *psz_cmd,
return VLC_SUCCESS;
}
+static enum pl_locked_state playlist_lock_status = pl_Unlocked;
static int StateChanged( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
@@ -968,9 +969,16 @@ static int StateChanged( vlc_object_t *p_this, char
const *psz_cmd,
int i_status;
char cmd[6];
+ if(pl_Locked == playlist_lock_status)
+ {
PL_LOCK;
+ }
i_status = playlist_Status( p_playlist );
+ if(pl_Locked == playlist_lock_status)
+ {
PL_UNLOCK;
+ }
+
switch( i_status )
{
@@ -1038,7 +1046,9 @@ static int Input( vlc_object_t *p_this, char const
*psz_cmd,
/* Parse commands that only require an input */
if( !strcmp( psz_cmd, "pause" ) )
{
+ playlist_lock_status = pl_Locked;
playlist_Pause( p_intf->p_sys->p_playlist );
+ playlist_lock_status = pl_Unlocked;
i_error = VLC_SUCCESS;
}
else if( !strcmp( psz_cmd, "seek" ) )
-----------------
--
--------------
HHCN: Andy chenee chenee at hhcn.com
Tel/Fax: +86-551-5325652,5325653-820
Products Info. : http://www.hhcn.com
Tech. Support : http://www.hhcn.org
HHTech : An Embedded Linux Tech. Provider in Mainland China
2008-08-13
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090811/d4f28d07/attachment.html>
More information about the vlc-devel
mailing list