View Single Post
Old 04-03-12, 02:15 PM   #1
bobo1on1
Registered User
 
Join Date: Dec 2006
Posts: 5
Default XBMC hangs in popen since 295.20

In XBMC we use popen with nvidia-settings to get the display refreshrate, since 295.20 this often hangs in the child process, 295.33 shows the same behavior.
The backtrace shows that the child process hangs on locking a mutex:
Code:
(gdb) thread apply all bt

Thread 1 (Thread 0xa9effb70 (LWP 3168)):
#0  0x00c37832 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x0037aaf9 in __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/lowlevellock.S:142
#2  0x00376149 in _L_lock_839 () from /lib/tls/i686/cmov/libpthread.so.0
#3  0x00375fdb in __pthread_mutex_lock (mutex=0xfeb7e0) at pthread_mutex_lock.c:82
#4  0x00fa6d91 in ?? () from /usr/lib/libGL.so.1
#5  0x01f244f6 in _IO_new_proc_open (fp=0x0, command=0x8bba318 "nvidia-settings -nt -q RefreshRate3", mode=0x8b9f8f9 "r") at iopopen.c:191
#6  0x01f2481a in _IO_new_popen (command=0x8bba318 "nvidia-settings -nt -q RefreshRate3", mode=0x8b9f8f9 "r") at iopopen.c:312
#7  0x0846cbfc in CVideoReferenceClock::ParseNvSettings (this=0x8e157a0, RefreshRate=@0xa9efeee8) at VideoReferenceClock.cpp:401
#8  0x0846d4b0 in CVideoReferenceClock::UpdateRefreshrate (this=0x8e157a0, Forced=true) at VideoReferenceClock.cpp:1193
#9  0x0846e5ac in CVideoReferenceClock::SetupGLX (this=0x8e157a0) at VideoReferenceClock.cpp:369
#10 0x0846e8f2 in CVideoReferenceClock::Process (this=0x8e157a0) at VideoReferenceClock.cpp:140
#11 0x08a50531 in CThread::staticThread (data=0x8e157a0) at Thread.cpp:177
#12 0x00fac0f1 in ?? () from /usr/lib/libGL.so.1
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)
This only happens when using OpenGL from one thread, and popen from another, it never hangs if popen is called from the render thread.
If the mutex was locked by another thread at the time the process is forked, it will never be unlucked in the child process, since the thread that originally locked it doesn't exist there.
bobo1on1 is offline   Reply With Quote