libvlc_media_player_stop deadlock
Posted: 27 Nov 2012 15:26
Hi!
I'm using libvlc 2.0.4 in a Qt 4.7 application. The integration was easy and it works well most of the time. The application streams data from a network camera using RTSP/RTP in both h264 video and aac audio.
Sometime however, the application freeze on a call to libvlc_media_player_stop.
I've tried several configuration of outputs :
default direct 3d
glwin32
Differents inputs (with both H264/AAC):
RTSP/RTP from Axis camera
RTSP/RTP from live555 media server
mkv
Different program paths:
allocate a new player instance for each play
Reuse the same instance
Try to free player without stopping (deadlock with a similar stack trace for thread 0)
So my conclusions for the moment are that the problem is unrelated to the input plugin nor to the output plugin but libvlccore locks when releasing these resources.
I created a simple program witch is close to the sample provided with the SDK. Given time, it will deadlock in the same way as my application does. It includes a sample video. My app doesn't stop and start as frequently as this program but the purpose here is to reproduce the bug as fast as possible.
File is located there : https://bugzillainc.averna.com/share/video_ui_test.7z
On my system, it is compiled with Qt 4.7.1 and windows sdk 7.1. My current target is x64 but I saw the same bug on win32.
I included the stack traces captured from QtCreator. I know its not gdb traces but i'm not (yet) capable of compiling libvlc with debug symbol on my own.
Any help on this bug would be greatly appreciated.
Thanks and regards,
Bruno Marchand
Thread 0
0 ZwWaitForMultipleObjects ntdll 0x77c118ca
1 WaitForMultipleObjectsEx KERNELBASE 0x7fefd501420
2 WaitForMultipleObjectsExImplementation kernel32 0x77652cf3
3 vlc_poll libvlccore 0x61e5226c
4 vlc_join libvlccore 0x61e52bb2
5 vout_Close libvlccore 0x61e17981
6 input_resource_Release libvlccore 0x61e0881d
7 input_resource_TerminateVout libvlccore 0x61e08ff9
8 libvlc_media_player_stop libvlc 0x7405abe6
9 VideoPlayWidget::setUrl video_play_widget.cpp 68 0x13f1a2deb
10 MainWindow::unsetIp mainwindow.cpp 33 0x13f1a15ef
11 MainWindow::qt_metacall moc_mainwindow.cpp 77 0x13f1a3246
12 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x59698de4
13 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596b5380
14 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x597532e0
15 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596c5445
16 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596b0792
17 QAction::isOn QtGuid4 0x51eefc66
18 QAction::isOn QtGuid4 0x51eecd61
19 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x5968d49a
20 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x59693a03
21 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596e0427
22 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596dfe39
23 UserCallWinProcCheckWow USER32 0x77ad9bd1
24 DispatchMessageWorker USER32 0x77ad98da
25 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596e127e
26 QAction::isOn QtGuid4 0x51fd91d5
27 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x5968a804
28 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x5968a989
29 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x5968db5c
30 QAction::isOn QtGuid4 0x51eec908
31 main main.cpp 15 0x13f1a122e
32 WinMain qtmain_win.cpp 131 0x13f1a4c61
33 __tmainCRTStartup crtexe.c 547 0x13f1a40a6
34 WinMainCRTStartup crtexe.c 371 0x13f1a3d9e
35 BaseThreadInitThunk kernel32 0x7764652d
36 RtlUserThreadStart ntdll 0x77bec521
Thread 1
0 ZwWaitForMultipleObjects ntdll 0x77c118ca
1 WaitForMultipleObjectsEx KERNELBASE 0x7fefd501420
2 WaitForMultipleObjectsExImplementation kernel32 0x77652cf3
3 vlc_poll libvlccore 0x61e5226c
4 vlc_cond_wait libvlccore 0x61e5284d
5 intf_Create libvlccore 0x61de19ff
6 vlc_sem_wait libvlccore 0x61e52c42
7 endthreadex msvcrt 0x7fefef6415f
8 endthreadex msvcrt 0x7fefef66ebd
9 BaseThreadInitThunk kernel32 0x7764652d
10 RtlUserThreadStart ntdll 0x77bec521
Thread 2
0 ZwWaitForMultipleObjects ntdll 0x77c118ca
1 TppWaiterpThread ntdll 0x77bdb007
2 BaseThreadInitThunk kernel32 0x7764652d
3 RtlUserThreadStart ntdll 0x77bec521
Thread 3
0 ZwWaitForMultipleObjects ntdll 0x77c118ca
1 WaitForMultipleObjectsEx KERNELBASE 0x7fefd501420
2 WaitForMultipleObjectsExImplementation kernel32 0x77652cf3
3 vlc_poll libvlccore 0x61e5226c
4 vlc_join libvlccore 0x61e52bb2
5 vlc_entry_license__1_2_0l libdirect3d_plugin 0x60305fa3
6 vlc_entry_license__1_2_0l libdirect3d_plugin 0x60306795
7 libdirect3d_plugin 0x60301971
8 vlc_module_unload libvlccore 0x61e35a78
9 vout_DeleteDisplay libvlccore 0x61e12a96
10 vout_EnableFilter libvlccore 0x61e1f6bd
11 vout_NewDisplay libvlccore 0x61e14fc4
12 vout_NewDisplay libvlccore 0x61e17263
13 vlc_sem_wait libvlccore 0x61e52c42
14 endthreadex msvcrt 0x7fefef6415f
15 endthreadex msvcrt 0x7fefef66ebd
16 BaseThreadInitThunk kernel32 0x7764652d
17 RtlUserThreadStart ntdll 0x77bec521
Thread 4
0 NtUserMessageCall USER32 0x77ad685a
1 RealDefWindowProcWorker USER32 0x77ad68a2
2 RealDefWindowProcA USER32 0x77acb96d
3 DefWindowProcA USER32 0x77acb900
4 vlc_entry_license__1_2_0l libdirect3d_plugin 0x603047f2
5 UserCallWinProcCheckWow USER32 0x77ad9bd1
6 DispatchClientMessage USER32 0x77ad72cb
7 _fnDWORD USER32 0x77ad6829
8 KiUserCallbackDispatcherContinue ntdll 0x77c11225
9 NtUserMessageCall USER32 0x77ad685a
10 RealDefWindowProcWorker USER32 0x77ad68a2
11 RealDefWindowProcA USER32 0x77acb96d
12 DefWindowProcA USER32 0x77acb900
13 vlc_entry_license__1_2_0l libdirect3d_plugin 0x603048e4
14 UserCallWinProcCheckWow USER32 0x77ad9bd1
15 DispatchClientMessage USER32 0x77ad72cb
16 _fnDWORD USER32 0x77ad6829
17 KiUserCallbackDispatcherContinue ntdll 0x77c11225
18 NtUserGetMessage USER32 0x77ad9e6a
19 GetMessageA USER32 0x77ad615e
20 vlc_entry_license__1_2_0l libdirect3d_plugin 0x60305139
21 vlc_sem_wait libvlccore 0x61e52c42
22 endthreadex msvcrt 0x7fefef6415f
23 endthreadex msvcrt 0x7fefef66ebd
24 BaseThreadInitThunk kernel32 0x7764652d
25 RtlUserThreadStart ntdll 0x77bec521
Thread 5
0 NtWaitForWorkViaWorkerFactory ntdll 0x77c12c1a
1 TppWorkerThread ntdll 0x77bdfe0b
2 BaseThreadInitThunk kernel32 0x7764652d
3 RtlUserThreadStart ntdll 0x77bec521
Thread 6
0 DbgBreakPoint ntdll 0x77c10530
1 DbgUiRemoteBreakin ntdll 0x77cb7ef8
2 BaseThreadInitThunk kernel32 0x7764652d
3 RtlUserThreadStart ntdll 0x77bec521
I'm using libvlc 2.0.4 in a Qt 4.7 application. The integration was easy and it works well most of the time. The application streams data from a network camera using RTSP/RTP in both h264 video and aac audio.
Sometime however, the application freeze on a call to libvlc_media_player_stop.
I've tried several configuration of outputs :
default direct 3d
glwin32
Differents inputs (with both H264/AAC):
RTSP/RTP from Axis camera
RTSP/RTP from live555 media server
mkv
Different program paths:
allocate a new player instance for each play
Reuse the same instance
Try to free player without stopping (deadlock with a similar stack trace for thread 0)
So my conclusions for the moment are that the problem is unrelated to the input plugin nor to the output plugin but libvlccore locks when releasing these resources.
I created a simple program witch is close to the sample provided with the SDK. Given time, it will deadlock in the same way as my application does. It includes a sample video. My app doesn't stop and start as frequently as this program but the purpose here is to reproduce the bug as fast as possible.
File is located there : https://bugzillainc.averna.com/share/video_ui_test.7z
On my system, it is compiled with Qt 4.7.1 and windows sdk 7.1. My current target is x64 but I saw the same bug on win32.
I included the stack traces captured from QtCreator. I know its not gdb traces but i'm not (yet) capable of compiling libvlc with debug symbol on my own.
Any help on this bug would be greatly appreciated.
Thanks and regards,
Bruno Marchand
Thread 0
0 ZwWaitForMultipleObjects ntdll 0x77c118ca
1 WaitForMultipleObjectsEx KERNELBASE 0x7fefd501420
2 WaitForMultipleObjectsExImplementation kernel32 0x77652cf3
3 vlc_poll libvlccore 0x61e5226c
4 vlc_join libvlccore 0x61e52bb2
5 vout_Close libvlccore 0x61e17981
6 input_resource_Release libvlccore 0x61e0881d
7 input_resource_TerminateVout libvlccore 0x61e08ff9
8 libvlc_media_player_stop libvlc 0x7405abe6
9 VideoPlayWidget::setUrl video_play_widget.cpp 68 0x13f1a2deb
10 MainWindow::unsetIp mainwindow.cpp 33 0x13f1a15ef
11 MainWindow::qt_metacall moc_mainwindow.cpp 77 0x13f1a3246
12 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x59698de4
13 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596b5380
14 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x597532e0
15 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596c5445
16 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596b0792
17 QAction::isOn QtGuid4 0x51eefc66
18 QAction::isOn QtGuid4 0x51eecd61
19 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x5968d49a
20 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x59693a03
21 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596e0427
22 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596dfe39
23 UserCallWinProcCheckWow USER32 0x77ad9bd1
24 DispatchMessageWorker USER32 0x77ad98da
25 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x596e127e
26 QAction::isOn QtGuid4 0x51fd91d5
27 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x5968a804
28 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x5968a989
29 QPersistentModelIndex::~QPersistentModelIndex QtCored4 0x5968db5c
30 QAction::isOn QtGuid4 0x51eec908
31 main main.cpp 15 0x13f1a122e
32 WinMain qtmain_win.cpp 131 0x13f1a4c61
33 __tmainCRTStartup crtexe.c 547 0x13f1a40a6
34 WinMainCRTStartup crtexe.c 371 0x13f1a3d9e
35 BaseThreadInitThunk kernel32 0x7764652d
36 RtlUserThreadStart ntdll 0x77bec521
Thread 1
0 ZwWaitForMultipleObjects ntdll 0x77c118ca
1 WaitForMultipleObjectsEx KERNELBASE 0x7fefd501420
2 WaitForMultipleObjectsExImplementation kernel32 0x77652cf3
3 vlc_poll libvlccore 0x61e5226c
4 vlc_cond_wait libvlccore 0x61e5284d
5 intf_Create libvlccore 0x61de19ff
6 vlc_sem_wait libvlccore 0x61e52c42
7 endthreadex msvcrt 0x7fefef6415f
8 endthreadex msvcrt 0x7fefef66ebd
9 BaseThreadInitThunk kernel32 0x7764652d
10 RtlUserThreadStart ntdll 0x77bec521
Thread 2
0 ZwWaitForMultipleObjects ntdll 0x77c118ca
1 TppWaiterpThread ntdll 0x77bdb007
2 BaseThreadInitThunk kernel32 0x7764652d
3 RtlUserThreadStart ntdll 0x77bec521
Thread 3
0 ZwWaitForMultipleObjects ntdll 0x77c118ca
1 WaitForMultipleObjectsEx KERNELBASE 0x7fefd501420
2 WaitForMultipleObjectsExImplementation kernel32 0x77652cf3
3 vlc_poll libvlccore 0x61e5226c
4 vlc_join libvlccore 0x61e52bb2
5 vlc_entry_license__1_2_0l libdirect3d_plugin 0x60305fa3
6 vlc_entry_license__1_2_0l libdirect3d_plugin 0x60306795
7 libdirect3d_plugin 0x60301971
8 vlc_module_unload libvlccore 0x61e35a78
9 vout_DeleteDisplay libvlccore 0x61e12a96
10 vout_EnableFilter libvlccore 0x61e1f6bd
11 vout_NewDisplay libvlccore 0x61e14fc4
12 vout_NewDisplay libvlccore 0x61e17263
13 vlc_sem_wait libvlccore 0x61e52c42
14 endthreadex msvcrt 0x7fefef6415f
15 endthreadex msvcrt 0x7fefef66ebd
16 BaseThreadInitThunk kernel32 0x7764652d
17 RtlUserThreadStart ntdll 0x77bec521
Thread 4
0 NtUserMessageCall USER32 0x77ad685a
1 RealDefWindowProcWorker USER32 0x77ad68a2
2 RealDefWindowProcA USER32 0x77acb96d
3 DefWindowProcA USER32 0x77acb900
4 vlc_entry_license__1_2_0l libdirect3d_plugin 0x603047f2
5 UserCallWinProcCheckWow USER32 0x77ad9bd1
6 DispatchClientMessage USER32 0x77ad72cb
7 _fnDWORD USER32 0x77ad6829
8 KiUserCallbackDispatcherContinue ntdll 0x77c11225
9 NtUserMessageCall USER32 0x77ad685a
10 RealDefWindowProcWorker USER32 0x77ad68a2
11 RealDefWindowProcA USER32 0x77acb96d
12 DefWindowProcA USER32 0x77acb900
13 vlc_entry_license__1_2_0l libdirect3d_plugin 0x603048e4
14 UserCallWinProcCheckWow USER32 0x77ad9bd1
15 DispatchClientMessage USER32 0x77ad72cb
16 _fnDWORD USER32 0x77ad6829
17 KiUserCallbackDispatcherContinue ntdll 0x77c11225
18 NtUserGetMessage USER32 0x77ad9e6a
19 GetMessageA USER32 0x77ad615e
20 vlc_entry_license__1_2_0l libdirect3d_plugin 0x60305139
21 vlc_sem_wait libvlccore 0x61e52c42
22 endthreadex msvcrt 0x7fefef6415f
23 endthreadex msvcrt 0x7fefef66ebd
24 BaseThreadInitThunk kernel32 0x7764652d
25 RtlUserThreadStart ntdll 0x77bec521
Thread 5
0 NtWaitForWorkViaWorkerFactory ntdll 0x77c12c1a
1 TppWorkerThread ntdll 0x77bdfe0b
2 BaseThreadInitThunk kernel32 0x7764652d
3 RtlUserThreadStart ntdll 0x77bec521
Thread 6
0 DbgBreakPoint ntdll 0x77c10530
1 DbgUiRemoteBreakin ntdll 0x77cb7ef8
2 BaseThreadInitThunk kernel32 0x7764652d
3 RtlUserThreadStart ntdll 0x77bec521