Bug 24504

Summary: XBMC can consistently be crashed with BadAccess GLX error, possibly related to UXA etc., need help debugging
Product: xorg Reporter: Leho Kraav (:macmaN :lkraav) <leho>
Component: Driver/intelAssignee: Ian Romanick <idr>
Status: RESOLVED WORKSFORME QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: leho
Version: 7.4 (2008.09)Keywords: NEEDINFO
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Leho Kraav (:macmaN :lkraav) 2009-10-13 10:19:33 UTC
XBMC is multiplatform OpenGL media center application. it has a python based plugin & scripting system. this crash occurs when these python scripts start setting up their display or drawing some controls.

i'm running gentoo 2.6.31-tuxonice, xorg-server-1.6.5, mesa 7.6, xf86-video-intel-2.9.0. X crashes with this error:

X Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 26 (X_GLXMakeContextCurrent)
Serial number of failed request: 2467
Current serial number in output stream: 2467

XBMC stack trace is as follows:

Core was generated by `/usr/share/xbmc/xbmc.bin --standalone'.
Program terminated with signal 11, Segmentation fault.
[New process 27933]
[New process 27663]
[New process 27694]
[New process 27680]
[New process 27684]
[New process 27679]
[New process 27683]
[New process 27681]
[New process 27637]
[New process 27682]
[New process 27685]
[New process 27686]
#0  0x08404a3c in CSectionLoader::UnloadDLL ()

Thread 12 (process 27686):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb6e6bfb2 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
#2  0x08778251 in NPT_PosixSharedVariable::WaitUntilEquals ()
#3  0x08733533 in PLT_ThreadTask::IsAborting ()
#4  0x08749b8e in PLT_SsdpDeviceAnnounceTask::DoRun ()
#5  0x0874c16b in PLT_ThreadTask::Run ()
#6  0x087788c1 in NPT_PosixThread::EntryPoint ()
#7  0xb6e6816f in start_thread () from /lib/libpthread.so.0
#8  0xb6633c0e in clone () from /lib/libc.so.6

Thread 11 (process 27685):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb662cf61 in select () from /lib/libc.so.6
#2  0x08773b96 in NPT_BsdSocketFd::WaitForCondition ()
#3  0x0877553a in NPT_BsdTcpServerSocket::WaitForNewClient ()
#4  0x08742259 in PLT_HttpListenTask<PLT_HttpServerListener>::DoRun ()
#5  0x0874c16b in PLT_ThreadTask::Run ()
#6  0x087788c1 in NPT_PosixThread::EntryPoint ()
#7  0xb6e6816f in start_thread () from /lib/libpthread.so.0
#8  0xb6633c0e in clone () from /lib/libc.so.6

Thread 10 (process 27682):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb662cf61 in select () from /lib/libc.so.6
#2  0x08773b96 in NPT_BsdSocketFd::WaitForCondition ()
#3  0x0877553a in NPT_BsdTcpServerSocket::WaitForNewClient ()
#4  0x08742259 in PLT_HttpListenTask<PLT_HttpServerListener>::DoRun ()
#5  0x0874c16b in PLT_ThreadTask::Run ()
#6  0x087788c1 in NPT_PosixThread::EntryPoint ()
#7  0xb6e6816f in start_thread () from /lib/libpthread.so.0
#8  0xb6633c0e in clone () from /lib/libc.so.6

Thread 9 (process 27637):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb6e6e799 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0xb6e69c80 in _L_lock_183 () from /lib/libpthread.so.0
#3  0xb6e696a5 in pthread_mutex_lock () from /lib/libpthread.so.0
#4  0x08807b43 in XCriticalSection::Enter ()
#5  0x082a7423 in CApplication::Render ()
#6  0x0850c4d8 in CXBApplicationEx::Run ()
#7  0x0850c9d4 in main ()

Thread 8 (process 27681):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb662cf61 in select () from /lib/libc.so.6
#2  0x08773b96 in NPT_BsdSocketFd::WaitForCondition ()
#3  0x08773cf8 in NPT_BsdSocketFd::WaitUntilReadable ()
#4  0x087740aa in NPT_BsdUdpSocket::Receive ()
#5  0x087339ae in PLT_InputDatagramStream::Read ()
#6  0x0875d313 in NPT_BufferedInputStream::FillBuffer ()
#7  0x0875ce88 in NPT_BufferedInputStream::ReadLine ()
#8  0x0875d256 in NPT_BufferedInputStream::ReadLine ()
#9  0x087627ee in NPT_HttpRequest::Parse ()
#10 0x08742dab in PLT_HttpServerSocketTask::Read ()
#11 0x08742b50 in PLT_HttpServerSocketTask::DoRun ()
#12 0x0874c16b in PLT_ThreadTask::Run ()
#13 0x087788c1 in NPT_PosixThread::EntryPoint ()
#14 0xb6e6816f in start_thread () from /lib/libpthread.so.0
#15 0xb6633c0e in clone () from /lib/libc.so.6

Thread 7 (process 27683):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb6e6bfb2 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
#2  0x08778251 in NPT_PosixSharedVariable::WaitUntilEquals ()
#3  0x08733533 in PLT_ThreadTask::IsAborting ()
#4  0x08732e63 in PLT_CtrlPointHouseKeepingTask::DoRun ()
#5  0x0874c16b in PLT_ThreadTask::Run ()
#6  0x087788c1 in NPT_PosixThread::EntryPoint ()
#7  0xb6e6816f in start_thread () from /lib/libpthread.so.0
#8  0xb6633c0e in clone () from /lib/libc.so.6

Thread 6 (process 27679):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb662cf61 in select () from /lib/libc.so.6
#2  0x08794b34 in socketSelect ()
#3  0x0879e9cc in CWebServer::Process ()
#4  0x0886dc68 in CThread::staticThread ()
#5  0xb6e6816f in start_thread () from /lib/libpthread.so.0
#6  0xb6633c0e in clone () from /lib/libc.so.6

Thread 5 (process 27684):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb662cf61 in select () from /lib/libc.so.6
#2  0x08773b96 in NPT_BsdSocketFd::WaitForCondition ()
#3  0x08773cf8 in NPT_BsdSocketFd::WaitUntilReadable ()
#4  0x087740aa in NPT_BsdUdpSocket::Receive ()
#5  0x087339ae in PLT_InputDatagramStream::Read ()
#6  0x0875d313 in NPT_BufferedInputStream::FillBuffer ()
#7  0x0875ce88 in NPT_BufferedInputStream::ReadLine ()
#8  0x0875d256 in NPT_BufferedInputStream::ReadLine ()
#9  0x08761ecb in NPT_HttpResponse::Parse ()
#10 0x08764b14 in NPT_HttpClient::ReadResponse ()
#11 0x08748ee8 in PLT_SsdpSearchTask::DoRun ()
#12 0x0874c16b in PLT_ThreadTask::Run ()
#13 0x087788c1 in NPT_PosixThread::EntryPoint ()
#14 0xb6e6816f in start_thread () from /lib/libpthread.so.0
#15 0xb6633c0e in clone () from /lib/libc.so.6

Thread 4 (process 27680):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb662a417 in poll () from /lib/libc.so.6
#2  0xb750972e in ?? () from /usr/lib/libavahi-common.so.3
#3  0x0aaa4ec8 in ?? ()
#4  0x00000002 in ?? ()
#5  0xffffffff in ?? ()
#6  0xb750cff4 in ?? () from /usr/lib/libavahi-common.so.3
#7  0xb42889c8 in ?? ()
#8  0xb42889c8 in ?? ()
#9  0xb19f9248 in ?? ()
#10 0xb7507e5d in avahi_simple_poll_run () from /usr/lib/libavahi-common.so.3
Backtrace stopped: frame did not save the PC

Thread 3 (process 27694):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb6e6bfb2 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
#2  0xb72fdd24 in SDL_CondWaitTimeout () from /usr/lib/libSDL-1.2.so.0
#3  0x087f5ef3 in ?? ()
#4  0x087f628b in WaitForMultipleObjects ()
#5  0x0886d838 in CThread::WaitForSingleObject ()
#6  0x087148fa in CScrobbler::Process ()
#7  0x0886dc68 in CThread::staticThread ()
#8  0xb6e6816f in start_thread () from /lib/libpthread.so.0
#9  0xb6633c0e in clone () from /lib/libc.so.6

Thread 2 (process 27663):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb6e6bfb2 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
#2  0xb72fdd24 in SDL_CondWaitTimeout () from /usr/lib/libSDL-1.2.so.0
#3  0x087f5ef3 in ?? ()
#4  0x087f5fd5 in WaitForSingleObject ()
#5  0x0886d78c in CThread::Sleep ()
#6  0x083d7cdc in MEDIA_DETECT::CDetectDVDMedia::Process ()
#7  0x0886dc68 in CThread::staticThread ()
#8  0xb6e6816f in start_thread () from /lib/libpthread.so.0
#9  0xb6633c0e in clone () from /lib/libc.so.6

Thread 1 (process 27933):
#0  0x08404a3c in CSectionLoader::UnloadDLL ()
#1  0x083d8c3c in DllDynamic::Unload ()
#2  0x083d8e8d in DllDynamic::~DllDynamic ()
#3  0x08630c57 in XCURL::DllLibCurlGlobal::~DllLibCurlGlobal ()
#4  0xb6592541 in exit () from /lib/libc.so.6
#5  0xb64815cd in _XDefaultError () from /usr/lib/libX11.so.6
#6  0xb648175c in _XError () from /usr/lib/libX11.so.6
#7  0xb67e2722 in glXMakeCurrentReadSGI ()
   from //usr//lib/opengl/xorg-x11/lib/libGL.so.1
#8  0xb67e28e3 in glXMakeCurrent ()
   from //usr//lib/opengl/xorg-x11/lib/libGL.so.1
#9  0x082845c1 in Surface::CSurface::MakeCurrent ()
#10 0x081d8d36 in CGraphicContext::ValidateSurface ()
#11 0x08277076 in CGLTexture::~CGLTexture ()
#12 0x08277757 in CTexture::Free ()
#13 0x08278083 in CTextureMap::~CTextureMap ()
#14 0x08277b4d in CGUITextureManager::Cleanup ()
#15 0x0827a09a in CGUITextureManager::~CGUITextureManager ()
#16 0xb6592541 in exit () from /lib/libc.so.6
#17 0xb64815cd in _XDefaultError () from /usr/lib/libX11.so.6
#18 0xb72ef519 in ?? () from /usr/lib/libSDL-1.2.so.0
#19 0x0a095b88 in ?? ()
#20 0xab3fc5bc in ?? ()
#21 0xab3fc588 in ?? ()
#22 0xb6464fbb in ?? () from /usr/lib/libX11.so.6
#23 0x0a058f30 in ?? ()
#24 0xb654dff4 in ?? () from /usr/lib/libX11.so.6
#25 0xab3fc628 in ?? ()
#26 0xb648175c in _XError () from /usr/lib/libX11.so.6
Backtrace stopped: frame did not save the PC
############# END STACK TRACE ###############

relevant information:

http://forum.boxee.tv/showthread.php?t=8487
http://xbmc.org/trac/ticket/7017

these scripts work when run on other platforms and other video cards (nvidia, ati).

any recommendations how to get to the bottom of this much appreciated.
Comment 1 Leho Kraav (:macmaN :lkraav) 2009-10-13 13:05:57 UTC
previous desc referred to running XBMC SVN 22528.

upgrading to SVN 23692 has improved this issue, will test and report further.
Comment 2 Eric Anholt 2009-10-23 15:06:20 UTC
handing glx issue to idr.  also, please explain what you mean by "improved"
Comment 3 Chris Pimlott 2009-11-02 16:56:12 UTC
I'm also seeing this issue with Boxee, an XBMC fork.  It happens 100% of the time after the initial Boxee login screen:

X Error of failed request:  BadAccess (attempt to access private resource denied)
  Major opcode of failed request:  153 (GLX)
  Minor opcode of failed request:  26 (X_GLXMakeContextCurrent)
  Serial number of failed request:  2896
  Current serial number in output stream:  2896

The issue started after upgrading from Mythbuntu 9.04 to 9.10, going from intel driver 2.6.99.1+git20090402 to 2.9.0+git20091026.
Comment 4 Leho Kraav (:macmaN :lkraav) 2009-11-02 23:35:23 UTC
i was actually thinking about closing this particular bug, because the newer XBMC SVN builds don't exhibit the same crash anymore, but obviously it would be nice to know what kind of NEEDINFO we could provide to debug this kind of thing?
Comment 5 Nick Andrade 2009-11-03 11:35:28 UTC
I can confirm seeing this issue in both XBMC and Boxee with at least Intel drivers 2.8.0 and Xorg server 1.6.2, possibly prior; the older (pre-UXA) drivers worked fine on the same hardware (Intel GMA 4500).
Comment 6 Ian Romanick 2009-11-09 10:15:05 UTC
(In reply to comment #4)
> i was actually thinking about closing this particular bug, because the newer
> XBMC SVN builds don't exhibit the same crash anymore, but obviously it would be
> nice to know what kind of NEEDINFO we could provide to debug this kind of
> thing?

I think the NEEDINFO was in reference to the statement in comment #1 "upgrading to SVN 23692 has improved this issue".  What is meant by improved?  It sounds like XBMC made some changes, and the bug is no longer reproducible.  Is that correct?

I tried version 9.04.1+svn20091002-0.0 on Debian with tip of Mesa, X server, and xf86-video-intel, and I was not able to reproduce this bug.
Comment 7 Leho Kraav (:macmaN :lkraav) 2009-11-10 02:17:26 UTC
(In reply to comment #6)
> I think the NEEDINFO was in reference to the statement in comment #1 "upgrading
> to SVN 23692 has improved this issue".  What is meant by improved?  It sounds
> like XBMC made some changes, and the bug is no longer reproducible.  Is that
> correct?

Yes, it would appear that some changes in XBMC stopped this particular bug.
Comment 8 Leho Kraav (:macmaN :lkraav) 2009-11-23 01:58:20 UTC
after changing to compiling built-in python in XBMC, i have no more crashes related to this plugin. i believe that was the culprit all along for me. not sure about the other cases here.
Comment 9 Ian Romanick 2009-11-23 10:44:33 UTC
Since this bug can no longer be reproduced, I'm going to close it.

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.