Created attachment 50585 [details] Crash backtrace Apps using phonon-vlc crash on quit after Phonon has seen use, e.g. playing a track in Amarok or playing a video in Dragon. Attached is a backtrace from Dragon on quitting it with a playing video having been paused beforehand. Dragon is 4.5.0; ffmpeg, VLC 1.1 and phonon-vlc are current git. Martin looked at the backtraces a few months ago (yes, this is a long-standing problem unfortunately) and said it's because two parts of the codebase seem to try and use XCloseDisplay(). He also believes PulseAudio is to blame because of what it does with X props on the root window or something along those lines. Martin also tells me that he doesn't wish to maintain the PulseAudio-related parts of Phonon nor is interested in fixing bugs in them, but that I should talk to you, Colin, instead, so I've added you to the CC list.
If it's related to XCloseDisplay, see the patch on http://pulseaudio.org/ticket/799 and see if it helps. This is currently applied in Mandriva cooker (and I've just pushed a build with this fix applied to 2010.1 main/testing too). If you use another distro, feel free to apply the PA patch yourself or by asking your friendly neighbourhood distro guy.
Rex, could you roll up a test package?
I should have CC'ed Rex in myself actually - my bad :) Rex FYI I just pushed the XCB patch out to PA's stable-queue, so if you want to just use it from there, that would work too.
Rex rolled a patched PulseAudio to test, and it still crashes. Amarok: Application: Amarok (amarok), signal: Segmentation fault 82 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS) [Current thread is 1 (Thread 0x7f7f3d48f860 (LWP 2308))] Thread 8 (Thread 0x7f7efe788710 (LWP 2312)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162 #1 0x00007f7f31266088 in Thread () from /home/sho/kdevel/4/install/lib/libvlccore.so.4 #2 0x00000031c2007761 in start_thread (arg=0x7f7efe788710) at pthread_create.c:301 #3 0x00000031c14e14ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 Thread 7 (Thread 0x7f7ef7fff710 (LWP 2317)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162 #1 0x00000031c8c7297b in wait (this=<value optimized out>, mutex=0x2d8b620, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:88 #2 QWaitCondition::wait (this=<value optimized out>, mutex=0x2d8b620, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160 #3 0x000000369fc09c04 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x2c2ff80, th=0x2c3e0b0) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WeaverImpl.cpp:365 #4 0x000000369fc0c59b in ThreadWeaver::WorkingHardState::applyForWork (this=0x2c59410, th=0x2c3e0b0) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WorkingHardState.cpp:71 #5 0x000000369fc0c5b4 in ThreadWeaver::WorkingHardState::applyForWork (this=0x2c59410, th=0x2c3e0b0) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WorkingHardState.cpp:74 #6 0x000000369fc0c5b4 in ThreadWeaver::WorkingHardState::applyForWork (this=0x2c59410, th=0x2c3e0b0) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WorkingHardState.cpp:74 #7 0x000000369fc0af6f in ThreadWeaver::ThreadRunHelper::run (this=0x7f7ef7ffed00, parent=0x2c2ff80, th=0x2c3e0b0) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/Thread.cpp:87 #8 0x000000369fc0b448 in ThreadWeaver::Thread::run (this=0x2c3e0b0) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/Thread.cpp:142 #9 0x00000031c8c71e7e in QThreadPrivate::start (arg=0x2c3e0b0) at thread/qthread_unix.cpp:266 #10 0x00000031c2007761 in start_thread (arg=0x7f7ef7fff710) at pthread_create.c:301 #11 0x00000031c14e14ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 Thread 6 (Thread 0x7f7ef58a1710 (LWP 2318)): #0 0x00000031c14da043 in select () at ../sysdeps/unix/syscall-template.S:82 #1 0x00000031c8d35d7d in QProcessManager::run (this=0x31c90814a0) at io/qprocess_unix.cpp:245 #2 0x00000031c8c71e7e in QThreadPrivate::start (arg=0x31c90814a0) at thread/qthread_unix.cpp:266 #3 0x00000031c2007761 in start_thread (arg=0x7f7ef58a1710) at pthread_create.c:301 #4 0x00000031c14e14ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 Thread 5 (Thread 0x7f7ef4ea0710 (LWP 2320)): #0 0x00000031c14a6a6d in nanosleep () at ../sysdeps/unix/syscall-template.S:82 #1 0x00000031c14a68e0 in __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:138 #2 0x00000031d9183d16 in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x31d9488de0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2363 #3 0x00000031d9183db9 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=0x7f7ef4e9fcd0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464 #4 0x00000031c2007761 in start_thread (arg=0x7f7ef4ea0710) at pthread_create.c:301 #5 0x00000031c14e14ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 Thread 4 (Thread 0x7f7ee3fff710 (LWP 2323)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162 #1 0x00000031c8c7297b in wait (this=<value optimized out>, mutex=0x2d8b620, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:88 #2 QWaitCondition::wait (this=<value optimized out>, mutex=0x2d8b620, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160 #3 0x000000369fc09c04 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x2c2ff80, th=0x2444410) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WeaverImpl.cpp:365 #4 0x000000369fc0c59b in ThreadWeaver::WorkingHardState::applyForWork (this=0x2c59410, th=0x2444410) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WorkingHardState.cpp:71 #5 0x000000369fc0af6f in ThreadWeaver::ThreadRunHelper::run (this=0x7f7ee3ffed00, parent=0x2c2ff80, th=0x2444410) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/Thread.cpp:87 #6 0x000000369fc0b448 in ThreadWeaver::Thread::run (this=0x2444410) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/Thread.cpp:142 #7 0x00000031c8c71e7e in QThreadPrivate::start (arg=0x2444410) at thread/qthread_unix.cpp:266 #8 0x00000031c2007761 in start_thread (arg=0x7f7ee3fff710) at pthread_create.c:301 #9 0x00000031c14e14ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 Thread 3 (Thread 0x7f7ee35fe710 (LWP 2324)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162 #1 0x00000031c8c7297b in wait (this=<value optimized out>, mutex=0x2d8b620, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:88 #2 QWaitCondition::wait (this=<value optimized out>, mutex=0x2d8b620, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160 #3 0x000000369fc09c04 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x2c2ff80, th=0x22f24b0) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WeaverImpl.cpp:365 #4 0x000000369fc0c59b in ThreadWeaver::WorkingHardState::applyForWork (this=0x2c59410, th=0x22f24b0) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WorkingHardState.cpp:71 #5 0x000000369fc0c5b4 in ThreadWeaver::WorkingHardState::applyForWork (this=0x2c59410, th=0x22f24b0) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WorkingHardState.cpp:74 #6 0x000000369fc0af6f in ThreadWeaver::ThreadRunHelper::run (this=0x7f7ee35fdd00, parent=0x2c2ff80, th=0x22f24b0) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/Thread.cpp:87 #7 0x000000369fc0b448 in ThreadWeaver::Thread::run (this=0x22f24b0) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/Thread.cpp:142 #8 0x00000031c8c71e7e in QThreadPrivate::start (arg=0x22f24b0) at thread/qthread_unix.cpp:266 #9 0x00000031c2007761 in start_thread (arg=0x7f7ee35fe710) at pthread_create.c:301 #10 0x00000031c14e14ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 Thread 2 (Thread 0x7f7ee19ce710 (LWP 2327)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162 #1 0x00000031c8c7297b in wait (this=<value optimized out>, mutex=0x2d8b620, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:88 #2 QWaitCondition::wait (this=<value optimized out>, mutex=0x2d8b620, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160 #3 0x000000369fc09c04 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x2c2ff80, th=0x35faa40) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WeaverImpl.cpp:365 #4 0x000000369fc0c59b in ThreadWeaver::WorkingHardState::applyForWork (this=0x2c59410, th=0x35faa40) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WorkingHardState.cpp:71 #5 0x000000369fc0c5b4 in ThreadWeaver::WorkingHardState::applyForWork (this=0x2c59410, th=0x35faa40) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/WorkingHardState.cpp:74 #6 0x000000369fc0af6f in ThreadWeaver::ThreadRunHelper::run (this=0x7f7ee19cdd00, parent=0x2c2ff80, th=0x35faa40) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/Thread.cpp:87 #7 0x000000369fc0b448 in ThreadWeaver::Thread::run (this=0x35faa40) at /usr/src/debug/kdelibs-4.5.0/threadweaver/Weaver/Thread.cpp:142 #8 0x00000031c8c71e7e in QThreadPrivate::start (arg=0x35faa40) at thread/qthread_unix.cpp:266 #9 0x00000031c2007761 in start_thread (arg=0x7f7ee19ce710) at pthread_create.c:301 #10 0x00000031c14e14ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 Thread 1 (Thread 0x7f7f3d48f860 (LWP 2308)): [KCrash Handler] #6 __pthread_mutex_lock (mutex=0x2e0000534c4f43) at pthread_mutex_lock.c:50 #7 0x00000031c3449da7 in XrmDestroyDatabase (db=0xe54200) at Xrm.c:2642 #8 0x00000031c343476d in _XFreeDisplayStructure (dpy=0xe449e0) at OpenDis.c:839 #9 0x00000031c341fcbf in XCloseDisplay (dpy=0xe449e0) at ClDisplay.c:82 #10 0x0000003695e201f5 in qt_cleanup () at kernel/qapplication_x11.cpp:2638 #11 0x0000003695dbcb10 in QApplication::~QApplication (this=0x7fffcf010c30, __in_chrg=<value optimized out>) at kernel/qapplication.cpp:1121 #12 0x00007f7f3eb96f37 in App::~App() () from /home/sho/kdevel/4/install/lib64/libamaroklib.so.1 #13 0x00000000004081a5 in main ()
Well in this case I don't see any PA references/threads, but I'd double check the code of your vlc library if that is the phonon backend you were using. If possibly try another phonon backend to see if this solves the issue. If it doesn't fix the issue then it likely is not the problem.
It only happens with phonon-vlc, sorry if I didn't make that clear in the initial report. It was Martin who blamed it on PulseAudio (but as you probably know best, that's the usual blamegame in town atm).
Actually it is quite clear in the original report that it's VLC only, but I'm a bit slow today :D I think then we can rule out PA's direct involvement if the XCB patch has been tested in this loop. I'm not sure where to go next, but just FYI Rémi wrote a nice description of the problems involved with Xlib here: http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/7283 which may go some way to hinting at where the problem lies. Thinking about it, VLC's pulseaudio output does still call XInitThreads due to PA #799 (which is no longer needed due to the XCB patch Rex applied to PA) so it may be worth you (or Rex if he's feeling generous!) commenting out the call to vlc_xlib_init() in modules/audio_output/pulse.c in the VLC package to test that? Or alternatively, just comment out the actual XInitThreads call in include/vlc_xlib.h itself to prevent *any* vlc module doing it... Worth a try to rule it out I guess.
Sorry, you people are too fast to react on bugs, even before I can mark this as a duplicate *sigh* *** This bug has been marked as a duplicate of bug 240001 ***
To be fair Myriam, seeing as I've commented and asked and said pretty much the same things on both, you'd think that *I'd* think to mark them as duplicates wouldn't you? :D
*** Bug 250604 has been marked as a duplicate of this bug. ***
Reassigning to the new bugzilla product for better bug tracing of the various backends. Sorry for the noise.