hi all:<br><br>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!<br><br>git version: 592f40d6b0c6010051d8867a791301cb90dbc760<br>

uname -a :Linux home 2.6.28-14-generic #46-Ubuntu SMP Wed Jul 8 07:21:34 UTC 2009 i686 GNU/Linux<br><br>error output:<br>--------<br>pause<br>LibVLC fatal error locking mutex (35) in thread 5518 at misc/pthread.c:215 in vlc_mutex_lock<br>
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f8604e]<br>/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f860db]<br>
/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(vlc_mutex_lock+0x57)[0xb7f86301]<br>/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(playlist_Lock+0x22)[0xb7f040bc]<br>/home/chenee/workstation/vlc/modules/control/.libs/librc_plugin.so[0xb7b15fad]<br>

/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f81f1c]<br>/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(var_SetChecked+0x13b)[0xb7f809a0]<br>/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f0466e]<br>

/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f04489]<br>/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(playlist_Control+0x47)[0xb7f04159]<br>/home/chenee/workstation/vlc/modules/control/.libs/librc_plugin.so[0xb7b1626a]<br>

/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f81f1c]<br>/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(var_SetChecked+0x13b)[0xb7f809a0]<br>/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4(__var_Set+0x3a)[0xb7f80a0b]<br>

/home/chenee/workstation/vlc/modules/control/.libs/librc_plugin.so[0xb7b14527]<br>/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f0198f]<br>/home/chenee/workstation/vlc/src/.libs/libvlccore.so.4[0xb7f7157a]<br>

/lib/tls/i686/cmov/libpthread.so.0[0xb7eb24ff]<br>/lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb7e2d49e]<br> Error message: Resource deadlock avoided<br>Aborted<br clear="all">--------------<br><br>2) I debug the vlc and found that:<br>
When type "pause",it first call "playlist_Pause( p_intf->p_sys->p_playlist );"to lock the playlist mutex,<br>But when var "state" changed, the callback function "StateChanged(xxx)" in rc.c will re-call  PL_LOCK;<br>
so, it crashed. <br><br>3) I use a local static variable to avoid it crash temporarily, expect better solutions!<br>------------<br>--- a/modules/control/rc.c<br>+++ b/modules/control/rc.c<br>@@ -959,6 +959,7 @@ static int VolumeChanged( vlc_object_t *p_this, char const *psz_cmd,<br>
     return VLC_SUCCESS;<br> }<br><br>+static enum pl_locked_state playlist_lock_status = pl_Unlocked;<br> static int StateChanged( vlc_object_t *p_this, char const *psz_cmd,<br>     vlc_value_t oldval, vlc_value_t newval, void *p_data )<br>
 {<br>@@ -968,9 +969,16 @@ static int StateChanged( vlc_object_t *p_this, char const *psz_cmd,<br>     int i_status;<br>     char cmd[6];<br><br>+    if(pl_Locked == playlist_lock_status)<br>+    {<br>     PL_LOCK;<br>+    }<br>
     i_status = playlist_Status( p_playlist );<br>+    if(pl_Locked == playlist_lock_status)<br>+    {<br>     PL_UNLOCK;<br>+    }<br>+<br><br>     switch( i_status )<br>     {<br>@@ -1038,7 +1046,9 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,<br>
     /* Parse commands that only require an input */<br>     if( !strcmp( psz_cmd, "pause" ) )<br>     {<br>+       playlist_lock_status = pl_Locked;<br>         playlist_Pause( p_intf->p_sys->p_playlist );<br>
+       playlist_lock_status = pl_Unlocked;<br>         i_error = VLC_SUCCESS;<br>     }<br>     else if( !strcmp( psz_cmd, "seek" ) )<br><br>-----------------<br><br><br><br>-- <br>--------------<br>HHCN: Andy chenee  <a href="mailto:chenee@hhcn.com" target="_blank">chenee@hhcn.com</a><br>
Tel/Fax: +86-551-5325652,5325653-820<br>Products Info. : <a href="http://www.hhcn.com" target="_blank">http://www.hhcn.com</a><br>Tech. Support  : <a href="http://www.hhcn.org" target="_blank">http://www.hhcn.org</a><br>
HHTech : An Embedded Linux Tech. Provider in Mainland China<br>2008-08-13<br>