Bug 109560

Summary: Sometimes VLC player process gets stuck in memory after closure if video output used is Auto or OpenGL
Product: Mesa Reporter: Strangiato <bugseforuns>
Component: GLXAssignee: mesa-dev
Status: RESOLVED MOVED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: viktor_jaegerskuepper
Version: 19.0   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Strangiato 2019-02-05 16:43:16 UTC
Problem was already rpeorted to VLC devs
https://trac.videolan.org/vlc/ticket/21875

My system: Arch Linux, Gnome 3.30.2 desktop environment (Wayland session), mesa 18.3.3, VLC 3.0.6

Hardware: 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)

Steps to reproduce: Set Auto or OpenGl as video output in VLC preferences
(open VLC, press ctrl+p to open its preferences, click "Video" tab, set output to OpenGL or Auto).
Play videos with VLC, close its window during video playback by clicking the button in the upper right corner.

Result: VLC process remains in the memory, I can't open VLC again until its process is killed manually. Such behavior does not occur if I stop the video before close VLC or if I close VLC using "File" menu > "Quit" instead the button in the upper right corner or if video output used is "Xvideo output (XCB)".

A VLC dev said there is a bug in Mesa or Intel GPU drivers.
https://trac.videolan.org/vlc/ticket/21875#comment:3


Thread 46 (Thread 0x7fff7db24700 (LWP 15857)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 ()
    at /usr/lib/libpthread.so.0
#1  0x00007fffb20fabe4 in  () at /usr/lib/dri/i965_dri.so
#2  0x00007fffb20fa908 in  () at /usr/lib/dri/i965_dri.so
#3  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#4  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 45 (Thread 0x7fffab4a1700 (LWP 15855)):
#0  0x00007ffff7e66c21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff4119630 in  () at /usr/lib/libxcb.so.1
#2  0x00007ffff411b3bb in xcb_wait_for_special_event () at /usr/lib/libxcb.so.1
#3  0x00007fff7dc8b2ce in  () at /usr/lib/libEGL_mesa.so.0
#4  0x00007fff7dc8b428 in  () at /usr/lib/libEGL_mesa.so.0
#5  0x00007fff7dc8c62e in  () at /usr/lib/libEGL_mesa.so.0
#6  0x00007fff7dc8d52c in  () at /usr/lib/libEGL_mesa.so.0
#7  0x00007fffb204dc33 in  () at /usr/lib/dri/i965_dri.so
#8  0x00007fffb204e385 in  () at /usr/lib/dri/i965_dri.so
#9  0x00007fffb2049453 in  () at /usr/lib/dri/i965_dri.so
#10 0x00007fff7eaa283b in vout_display_opengl_Display (vgl=0x7fffa45ea900, source=source@entry=0x7fffa4008118) at video_output/opengl/vout_helper.c:1674
#11 0x00007fff7eaa873e in PictureDisplay (vd=0x7fffa40080e0, pic=0x7fff94051620, subpicture=0x7fffa462d010) at video_output/opengl/display.c:221
#12 0x00007ffff7ce8522 in vout_display_Display (subpicture=0x7fffa462d010, picture=0x7fff94051620, vd=0x7fffa40080e0) at ../include/vlc_vout_wrapper.h:57
#13 0x00007ffff7ce8522 in ThreadDisplayRenderPicture (vout=vout@entry=0x7fffbc000990, is_forced=<optimized out>) at video_output/video_output.c:1178
#14 0x00007ffff7cea15a in ThreadDisplayPicture (vout=vout@entry=0x7fffbc000990, deadline=0xda419f36a7457200, deadline@entry=0x7fffab4a0ce8) at video_output/video_output.c:1249
#15 0x00007ffff7cea3e0 in Thread (object=0x7fffbc000990) at video_output/video_output.c:1810
#16 0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#17 0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 44 (Thread 0x7fff7fa3f700 (LWP 15854)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007ffff7d206c6 in vlc_cond_wait (p_condvar=<optimized out>, p_mutex=<optimized out>) at posix/thread.c:272
#2  0x00007ffff7d0a5cf in vlc_fifo_WaitCond (fifo=<optimized out>, condvar=<optimized out>) at misc/fifo.c:71
#3  0x00007ffff7d0a5da in vlc_fifo_Wait (fifo=<optimized out>) at misc/fifo.c:66
#4  0x00007ffff7cb594e in DecoderThread (p_data=<optimized out>) at input/decoder.c:1608
#5  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#6  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 43 (Thread 0x7fff7f93e700 (LWP 15853)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007fff870b8044 in  () at /usr/lib/libavcodec.so.58
#2  0x00007fff86d2a3b5 in  () at /usr/lib/libavcodec.so.58
#3  0x00007fff86d2add8 in avcodec_send_packet () at /usr/lib/libavcodec.so.58
#4  0x00007fffa8a17b48 in DecodeBlock (error=<synthetic pointer>, pp_block=<optimized out>, p_dec=<optimized out>) at codec/avcodec/video.c:1041
#5  0x00007fffa8a17b48 in DecodeVideo (p_dec=<optimized out>, p_block=<optimized out>) at codec/avcodec/video.c:1246
#6  0x00007ffff7cb5487 in DecoderDecode (p_dec=0x7fff98cc42d0, p_block=0x7fff98da3260) at input/decoder.c:1340
#7  0x00007ffff7cb5024 in DecoderProcess (p_dec=p_dec@entry=0x7fff98cc42d0, p_block=p_block@entry=0x7fff98da3260) at input/decoder.c:1463
#8  0x00007ffff7cb56d0 in DecoderThread (p_data=<optimized out>) at input/decoder.c:1619
#9  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#10 0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 42 (Thread 0x7fff7f83d700 (LWP 15852)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007fff870b85ef in  () at /usr/lib/libavcodec.so.58
#2  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#3  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 41 (Thread 0x7fffb0e38700 (LWP 15851)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007fff870b85ef in  () at /usr/lib/libavcodec.so.58
#2  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#3  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 40 (Thread 0x7fffab209700 (LWP 15850)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007fff870b85ef in  () at /usr/lib/libavcodec.so.58
#2  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#3  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 39 (Thread 0x7fffabefa700 (LWP 15849)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007ffff7d206c6 in vlc_cond_wait (p_condvar=<optimized out>, p_mutex=<optimized out>) at posix/thread.c:272
#2  0x00007ffff7d0e42c in picture_pool_Wait (pool=0x7fffa463cfc0) at misc/picture_pool.c:262
#3  0x00007ffff7cebaaa in vout_GetPicture (vout=0x7fffbc000990) at video_output/video_output.c:409
#4  0x00007fffa8a17451 in decoder_NewPicture (dec=0x7fff98cc42d0) at ../include/vlc_codec.h:291
#5  0x00007fffa8a17451 in lavc_GetFrame (ctx=0x7fff98ce8500, frame=0x7fff98ce8d80, flags=<optimized out>) at codec/avcodec/video.c:1492
#6  0x00007fff86d2cb73 in  () at /usr/lib/libavcodec.so.58
#7  0x00007fff870b9358 in  () at /usr/lib/libavcodec.so.58
#8  0x00007fff86e3eb63 in  () at /usr/lib/libavcodec.so.58
#9  0x00007fff86e3fcf5 in  () at /usr/lib/libavcodec.so.58
#10 0x00007fff86e44988 in  () at /usr/lib/libavcodec.so.58
#11 0x00007fff86e48609 in  () at /usr/lib/libavcodec.so.58
#12 0x00007fff870b8489 in  () at /usr/lib/libavcodec.so.58
#13 0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#14 0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 38 (Thread 0x7fffcb7fe700 (LWP 15848)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007fff870b85ef in  () at /usr/lib/libavcodec.so.58
#2  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#3  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 33 (Thread 0x7fff84143700 (LWP 15843)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007ffff7d206c6 in vlc_cond_wait (p_condvar=<optimized out>, p_mutex=<optimized out>) at posix/thread.c:272
#2  0x00007ffff7ce266d in vout_control_WaitEmpty (ctrl=0x7fffbc000b50) at video_output/control.c:97
#3  0x00007ffff7ceb780 in vout_Cancel (vout=<optimized out>, canceled=<optimized out>) at video_output/video_output.c:311
#4  0x00007ffff7cb7351 in input_DecoderDelete (p_dec=0x7fff98cc42d0) at input/decoder.c:2007
#5  0x00007ffff7cbd723 in EsDestroyDecoder (out=0x7fffa00059e0, p_es=0x7fff98c84cb0, p_es=0x7fff98c84cb0) at input/es_out.c:1713
#6  0x00007ffff7cbd723 in EsUnselect (out=out@entry=0x7fffa00059e0, es=0x7fff98c84cb0, b_update=<optimized out>) at input/es_out.c:1841
#7  0x00007ffff7cc0a46 in EsOutControlLocked (args=<optimized out>, i_query=<optimized out>, out=0x7fffa00059e0) at input/es_out.c:2323
#8  0x00007ffff7cc0a46 in EsOutControl (out=0x7fffa00059e0, i_query=<optimized out>, args=<optimized out>) at input/es_out.c:2900
#9  0x00007ffff7cc2f09 in es_out_vaControl (args=0x7fff84142c10, i_query=<optimized out>, out=<optimized out>) at ../include/vlc_es_out.h:150
#10 0x00007ffff7cc2f09 in es_out_Control (out=<optimized out>, i_query=<optimized out>) at ../include/vlc_es_out.h:150
#11 0x00007ffff7cc4e8d in ControlLocked (args=<optimized out>, i_query=<optimized out>, p_out=<optimized out>) at input/es_out_timeshift.c:664
#12 0x00007ffff7cc4e8d in Control (p_out=<optimized out>, i_query=<optimized out>, args=<optimized out>) at input/es_out_timeshift.c:764
#13 0x00007ffff7cc6b69 in es_out_vaControl (args=0x7fff84142d70, i_query=65536, out=<optimized out>) at ../include/vlc_es_out.h:150
#14 0x00007ffff7cc6b69 in es_out_Control (out=<optimized out>, i_query=i_query@entry=65536) at ../include/vlc_es_out.h:150
#15 0x00007ffff7cc7c6c in es_out_SetMode (i_mode=0, p_out=<optimized out>) at input/es_out.h:95
#16 0x00007ffff7cc7c6c in End (p_input=0x7fffa0000990) at input/input.c:1484
#17 0x00007ffff7ccf02e in Run (data=0x7fffa0000990) at input/input.c:508
#18 0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#19 0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 13 (Thread 0x7fffb1b0b700 (LWP 15735)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007fffb20fabe4 in  () at /usr/lib/dri/i965_dri.so
#2  0x00007fffb20fa908 in  () at /usr/lib/dri/i965_dri.so
#3  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#4  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 12 (Thread 0x7fffb2eaf700 (LWP 15732)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007ffff7d206c6 in vlc_cond_wait (p_condvar=<optimized out>, p_mutex=<optimized out>) at posix/thread.c:272
#2  0x00007ffff7d1ef70 in vlc_timer_thread (data=0x7fffd8537440) at posix/timer.c:65
#3  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#4  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 11 (Thread 0x7fffc8aaf700 (LWP 15731)):
#0  0x00007ffff7e66c21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff4b96540 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff4b9662e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff0c7f5a9 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#4  0x00007ffff0c2858c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#5  0x00007ffff0a6c5c9 in QThread::exec() () at /usr/lib/libQt5Core.so.5
#6  0x00007fffd3e03ba6 in  () at /usr/lib/libQt5DBus.so.5
#7  0x00007ffff0a6d9cc in  () at /usr/lib/libQt5Core.so.5
#8  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#9  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 10 (Thread 0x7fffca7fc700 (LWP 15730)):
#0  0x00007ffff7e66c21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff4b96540 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff4b9662e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007fffd0428bde in  () at /usr/lib/gio/modules/libdconfsettings.so
#4  0x00007ffff4b7167b in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#6  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 9 (Thread 0x7fffcaffd700 (LWP 15729)):
#0  0x00007ffff7e66c21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff4b96540 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff4b975c2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#3  0x00007fffd1340cb8 in  () at /usr/lib/libgio-2.0.so.0
#4  0x00007ffff4b7167b in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#6  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 7 (Thread 0x7fffcbfff700 (LWP 15727)):
#0  0x00007ffff7e66c21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff4b96540 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff4b9662e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff4b96682 in  () at /usr/lib/libglib-2.0.so.0
#4  0x00007ffff4b7167b in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#6  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 6 (Thread 0x7fffd2f78700 (LWP 15726)):
#0  0x00007ffff7e66c21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff4119630 in  () at /usr/lib/libxcb.so.1
#2  0x00007ffff411b2db in xcb_wait_for_event () at /usr/lib/libxcb.so.1
#3  0x00007fffd3eeb96b in  () at /usr/lib/libQt5XcbQpa.so.5
#4  0x00007ffff0a6d9cc in  () at /usr/lib/libQt5Core.so.5
#5  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#6  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 5 (Thread 0x7ffff0183700 (LWP 15725)):
#0  0x00007ffff7e66c21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff4b96540 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff4b9662e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff0c7f5a9 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#4  0x00007ffff0c2858c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#5  0x00007ffff0c30896 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#6  0x00007ffff1b92ee5 in ThreadPlatform(void*, char*) (obj=0x55555566c210, platform_name=<optimized out>) at gui/qt/qt.cpp:643
#7  0x00007ffff1b939a6 in ThreadXCB(void*) (data=<optimized out>) at gui/qt/qt.cpp:368
#8  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#9  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7ffff2145700 (LWP 15724)):
#0  0x00007ffff7e66c21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff46337c5 in poll (__timeout=-1, __nfds=<optimized out>, __fds=0x7ffff2144d60) at /usr/include/bits/poll2.h:46
#2  0x00007ffff46337c5 in Run (data=0x55555565c160) at control/dbus/dbus.c:792
#3  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#4  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7ffff3bfc700 (LWP 15723)):
#0  0x00007ffff7f4cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007ffff7d206c6 in vlc_cond_wait (p_condvar=<optimized out>, p_mutex=<optimized out>) at posix/thread.c:272
#2  0x00007ffff7c9cc2a in LoopInput (p_playlist=0x55555555e530) at playlist/thread.c:439
#3  0x00007ffff7c9cc2a in Thread (data=0x55555555e530) at playlist/thread.c:495
#4  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#5  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7ffff2946700 (LWP 15722)):
#0  0x00007ffff7e66c21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff43ed673 in  () at /usr/lib/libpulse.so.0
#2  0x00007ffff43de990 in pa_mainloop_poll () at /usr/lib/libpulse.so.0
#3  0x00007ffff43defe0 in pa_mainloop_iterate () at /usr/lib/libpulse.so.0
#4  0x00007ffff43df091 in pa_mainloop_run () at /usr/lib/libpulse.so.0
#5  0x00007ffff43ed5ae in  () at /usr/lib/libpulse.so.0
#6  0x00007ffff418c9fc in  () at /usr/lib/pulseaudio/libpulsecommon-12.2.so
#7  0x00007ffff7f46a9d in start_thread () at /usr/lib/libpthread.so.0
#8  0x00007ffff7e71b23 in clone () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7ffff7621100 (LWP 15716)):
#0  0x00007ffff7f47f6d in __pthread_timedjoin_ex () at /usr/lib/libpthread.so.0
#1  0x00007ffff1b925f2 in Close(vlc_object_t*) (p_this=0x55555566c210) at gui/qt/qt.cpp:489
#2  0x00007ffff7c9458e in vlc_module_unload (obj=obj@entry=0x55555566c210, module=<optimized out>, deinit=deinit@entry=0x7ffff7c93a30 <generic_stop>) at modules/modules.c:343
#3  0x00007ffff7c94647 in module_unneed (obj=obj@entry=0x55555566c210, module=<optimized out>) at modules/modules.c:378
#4  0x00007ffff7c9b1a1 in intf_DestroyAll (libvlc=0x55555555a570) at interface/interface.c:254
#5  0x00007ffff7c7d34f in libvlc_InternalCleanup (p_libvlc=0x55555555a570) at libvlc.c:391
#6  0x00007ffff7f6931b in libvlc_release (p_instance=0x55555555a410) at core.c:104
#7  0x0000555555555337 in main (i_argc=<optimized out>, ppsz_argv=<optimized out>) at vlc.c:275
Comment 1 Strangiato 2019-03-19 19:54:52 UTC
This bug persists on Arch Linux after upgrade to mesa 19.
Comment 2 jamesz@amd.com 2019-03-19 20:11:44 UTC
Can you add attachment of dmesg when issue occurred? Thanks! James
Comment 3 Strangiato 2019-03-19 21:06:25 UTC
dmesg shows no error.
Comment 4 Strangiato 2019-04-13 16:54:43 UTC
Bug persists with mesa 19.0.2 on Arch Linux.
Comment 5 Timothy Arceri 2019-04-15 01:04:53 UTC
The VLC devs could have provided more information on why they believe this is a Mesa bug.

Its hard to tell because there are so many threads but it looks like maybe it gets stuck waiting in xcb_wait_for_special_event(). Could be a bug in libxcb but I'm just guessing.
Comment 6 Michel Dänzer 2019-04-15 17:02:22 UTC
I was able to reproduce this, below is a better backtrace of the hanging thread. Looks like it's waiting for a Present idle event. Not sure yet if this Mesa's fault (maybe it missed the event while the context wasn't current), or maybe the X server failed to send an event when it should (e.g. because the window was unmapped). Most likely not an XCB issue though.

Thread 16 (Thread 0x7f697df1f700 (LWP 9784)):
#0  0x00007f69ec60eb69 in __GI___poll (fds=0x7f697df1e508, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f69e8c64cf7 in  () at /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f69e8c66a0a in xcb_wait_for_special_event () at /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f69e1088bf5 in dri3_wait_for_event_locked (draw=0x7f697432bf98) at ../src/loader/loader_dri3_helper.c:545
#4  0x00007f69e1088bf5 in dri3_wait_for_event_locked (draw=0x7f697432bf98) at ../src/loader/loader_dri3_helper.c:529
#5  0x00007f69e1088ef7 in dri3_find_back (draw=draw@entry=0x7f697432bf98) at ../src/loader/loader_dri3_helper.c:670
#6  0x00007f69e1089666 in dri3_get_buffer (format=format@entry=4098, buffer_type=buffer_type@entry=loader_dri3_buffer_back, draw=draw@entry=0x7f697432bf98, driDrawable=<optimized out>) at ../src/loader/loader_dri3_helper.c:1800
#7  0x00007f69e108a590 in loader_dri3_get_buffers (driDrawable=<optimized out>, format=4098, stamp=0x7f697431f5a0, loaderPrivate=0x7f697432bf98, buffer_mask=<optimized out>, buffers=0x7f697df1e830) at ../src/loader/loader_dri3_helper.c:2019
#8  0x00007f69c4e03de0 in dri_image_drawable_get_buffers (statts_count=<optimized out>, statts=<optimized out>, images=<optimized out>, drawable=<optimized out>) at ../src/gallium/state_trackers/dri/dri2.c:339
#9  0x00007f69c4e03de0 in dri2_allocate_textures (ctx=0x7f697431f950, drawable=0x7f697431f5a0, statts=0x7f69740504a0, statts_count=1) at ../src/gallium/state_trackers/dri/dri2.c:466
#10 0x00007f69c4e05f72 in dri_st_framebuffer_validate (stctx=<optimized out>, stfbi=<optimized out>, statts=0x7f69740504a0, count=1, out=0x7f697df1e9a0) at ../src/gallium/state_trackers/dri/dri_drawable.c:85
#11 0x00007f69c5196117 in st_framebuffer_validate (stfb=0x7f697404ffd0, st=st@entry=0x7f697404a920) at ../src/mesa/state_tracker/st_manager.c:222
#12 0x00007f69c5196456 in st_api_make_current (stapi=<optimized out>, stctxi=0x7f697404a920, stdrawi=0x7f697431f5a0, streadi=0x7f697431f5a0) at ../src/mesa/state_tracker/st_manager.c:1082
#13 0x00007f69c4e059cd in dri_make_current (cPriv=<optimized out>, driDrawPriv=<optimized out>, driReadPriv=<optimized out>) at ../src/gallium/state_trackers/dri/dri_context.c:301
#14 0x00007f69c4dffe54 in driBindContext (pcp=<optimized out>, pdp=<optimized out>, prp=<optimized out>) at ../src/mesa/drivers/dri/common/dri_util.c:579
#15 0x00007f69e107e546 in dri3_bind_context (context=0x7f697431f7b0, old=<optimized out>, draw=88080385, read=88080385) at ../src/glx/dri3_glx.c:210
#16 0x00007f69e106a684 in MakeContextCurrent (dpy=0x7f6974150740, draw=88080385, read=88080385, gc_user=0x7f697431f7b0) at ../src/glx/glxcurrent.c:220
#17 0x00007f697daa936b in  () at /usr/lib/x86_64-linux-gnu/vlc/plugins/video_output/libglx_plugin.so
#18 0x00007f697de14632 in  () at /usr/lib/x86_64-linux-gnu/vlc/plugins/video_output/libgl_plugin.so
#19 0x00007f69ec44111e in vlc_module_unload () at /usr/lib/x86_64-linux-gnu/libvlccore.so.9
#20 0x00007f69ec490e6d in  () at /usr/lib/x86_64-linux-gnu/libvlccore.so.9
#21 0x00007f69ec4a115c in  () at /usr/lib/x86_64-linux-gnu/libvlccore.so.9
#22 0x00007f69ec494506 in  () at /usr/lib/x86_64-linux-gnu/libvlccore.so.9
#23 0x00007f69ec495dea in  () at /usr/lib/x86_64-linux-gnu/libvlccore.so.9
#24 0x00007f69ec6f7fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#25 0x00007f69ec61982f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Comment 7 Michel Dänzer 2019-05-17 17:00:18 UTC
(In reply to Michel Dänzer from comment #6)
> Not sure yet if this Mesa's fault (maybe it missed the event while the context
> wasn't current), or maybe the X server failed to send an event when it should
> (e.g. because the window was unmapped).

So far I'm not seeing how either of that could be the case.

> Most likely not an XCB issue though.

I'm not sure about this anymore, since thread 6 (from Qt) is stuck in xcb_wait_for_event. Maybe there's some kind of bad interaction between that and xcb_wait_for_special_event.

Anyway, I won't be able to investigate more for a couple of weeks at least.
Comment 8 Michel Dänzer 2019-07-19 17:00:58 UTC
(In reply to Michel Dänzer from comment #7)
> > [...] maybe the X server failed to send an event when it should
> > (e.g. because the window was unmapped).

I've now confirmed this is what's happening. VLC has already destroyed the X11 window at this point, so the X server can't send any Present events for it anymore.

It might be tricky to make Mesa robust against this... While the GLX spec says this should be handled gracefully, I suspect it might be easier for VLC to destroy the GLX context before the window.


> > Most likely not an XCB issue though.
> 
> I'm not sure about this anymore, since thread 6 (from Qt) is stuck in
> xcb_wait_for_event.

That's using a different XCB display handle, so unrelated.
Comment 9 GitLab Migration User 2019-09-18 17:46:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/116.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.