Bug 477203 - JVM crashes on exit when the PulseAudio daemon fails to start through alsa-plugins-pulse
JVM crashes on exit when the PulseAudio daemon fails to start through alsa-pl...
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: pulseaudio (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Lennart Poettering
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-19 11:53 EST by Omair Majid
Modified: 2009-08-10 16:44 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 482797 (view as bug list)
Environment:
Last Closed: 2009-08-10 16:44:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test program (578 bytes, text/x-java)
2008-12-19 11:55 EST, Omair Majid
no flags Details
backtrace (6.86 KB, application/octet-stream)
2008-12-19 11:56 EST, Omair Majid
no flags Details

  None (edit)
Description Omair Majid 2008-12-19 11:53:44 EST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) 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

Reproducible: Always

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
Actual Results:  
JVM crashes

Expected Results:  
JVM shuts down noramlly

Relevant Packages:
pulseaudio-0.9.13-6.fc10.i386
alsa-plugins-pulseaudio-1.0.18-1.rc3.fc10.i386
alsa-lib-1.0.18-6.rc3.fc10.i386
java-1.6.0-openjdk-1.6.0.0-7.b12.fc10.i386
Comment 1 Omair Majid 2008-12-19 11:55:01 EST
Created attachment 327461 [details]
test program
Comment 2 Omair Majid 2008-12-19 11:56:22 EST
Created attachment 327462 [details]
backtrace
Comment 3 Eric Moret 2008-12-19 17:21:07 EST
Shouldn´t this be opened against the jvm?
Comment 4 Omair Majid 2008-12-22 11:00:14 EST
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.
Comment 5 Eric Moret 2008-12-22 18:55:44 EST
Thank you for your analysis, I am reassigning this one to Lennard, from the upstream project.
Comment 6 Catagne 2009-01-30 03:26:55 EST
This may be related to https://bugzilla.redhat.com/show_bug.cgi?id=482797
Comment 7 Catagne 2009-02-26 07:57:39 EST
Defintely a duplicate of 
https://bugzilla.redhat.com/show_bug.cgi?id=482797

See there for simple test code.
Comment 8 Lennart Poettering 2009-03-04 16:03:55 EST
Hmm, I cannot reproduce this here.

Does this still happen with 0.9.14?
Comment 9 Lennart Poettering 2009-03-04 16:10:23 EST
Hmm, tried on both x86-64 and i386 now with no luck.
Comment 10 Omair Majid 2009-03-04 16:21:21 EST
I can reproduce this on i386 with pulseaudio-0.9.14-1.fc10.i386 :(
Comment 11 Catagne 2009-03-04 19:10:37 EST
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.
Comment 12 Catagne 2009-03-04 19:11:34 EST
Oups sorry, the latest comment was for  Bug 482797...
Comment 13 Lennart Poettering 2009-07-31 10:15:01 EDT
Does JVM call snd_config_update_free_global or snd_dlobj_cache_cleanup()?
Comment 14 Lennart Poettering 2009-08-10 16:44:41 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.