Red Hat Bugzilla – Bug 477203
JVM crashes on exit when the PulseAudio daemon fails to start through alsa-plugins-pulse
Last modified: 2009-08-10 16:44:41 EDT
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:18.104.22.168) Gecko/2008111217 Fedora/3.0.4-1.fc10 Firefox/3.0.4
If connection to a PulseAudio daemon fails, then the the Java runtime throws an exception, which is expected. But then the Java runtime crashes on exit. This happens only when using the ALSA api which redirects to PulseAudio. It doesnt happen when using the PulseAudio api directly. It seems to be very similar to 460666: segfault/corrpution in pthread_create.c
Steps to Reproduce:
1. chmod 000 ~/.pulse/* so that the pulseaudio daemon fails to start (kill any instances running)
2. compile and run the attached program
a. javac Mixers.java
b. java Mixers
3. press enter to end the program
JVM shuts down noramlly
Created attachment 327461 [details]
Created attachment 327462 [details]
Shouldn´t this be opened against the jvm?
Hi Eric. I am an IcedTea developer and I came across this bug when playing around with pulseaudio. I could be totally wrong about this being an alsa-plugins (or pulseaudio) bug, but I dont think that the JVM was the cause of the problem. Here is my reasoning:
1) The JVM crashes on exit, not when it's using the alsa api.
2) The error appears to be in pthread_create.c (in libpthread.so) and native threads are not directly used by java when it interacts with alsa. Any problem with Java Threads would not cause the JVM to crash with stack corruption.
3) the gdb backtrace shows the problem to be
#13 <signal handler called>
#14 0x082ca300 in ?? ()
#15 0x007cc5ca in __nptl_deallocate_tsd () at pthread_create.c:154
#16 start_thread (arg=0x161b90) at pthread_create.c:304
which indicates that there is some problem with Thread Specific Data. PulseAudio has had problems like this before but they were fixed: http://www.redhat.com/archives/fedora-extras-commits/2008-November/msg00096.html.
Also, this crash only happens when spawning the pulseaudio daemon fails. If pulseaudio is already running or is spawned successfully, then there are no crashes.
Anyway, I am not sure at all what the problem is, or what I can do to fix it. Any help will be appreciated. If you still think this is opened against the wrong package, let me know.
Thank you for your analysis, I am reassigning this one to Lennard, from the upstream project.
This may be related to https://bugzilla.redhat.com/show_bug.cgi?id=482797
Defintely a duplicate of
See there for simple test code.
Hmm, I cannot reproduce this here.
Does this still happen with 0.9.14?
Hmm, tried on both x86-64 and i386 now with no luck.
I can reproduce this on i386 with pulseaudio-0.9.14-1.fc10.i386 :(
Can reproduce the bug with the same version of pulseaudio, Fedora 10 up to date, on my 3 machines that all differ in audio and processor/motherboard hardware.
Oups sorry, the latest comment was for Bug 482797...
Does JVM call snd_config_update_free_global or snd_dlobj_cache_cleanup()?
OK, I think I know what's going on here: libpulse.so installs a TLS destructor but then gets unloaded so that the destructor function is called without existing in memory anymore, thus triggering a segfault.
This has been fixed in PA 0.9.16 now, we link everything with -z nodelete.