Netbeans crashes with JDK8

Bug #1234253 reported by gerard ziemski
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

We (Oracle) have our own issue filed addressing this problem: https://bugs.openjdk.java.net/browse/JDK-8025568

In summary - NetBeans with JDK8 crashes here on Ubuntu 13.4

GDB session info:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffac9e6700 (LWP 28401)]
0x00007fff9c539880 in ?? ()
(gdb) bt
#0 0x00007fff9c539880 in ?? ()
#1 0x00007ffff73dbd92 in __nptl_deallocate_tsd () from /lib/x86_64-linux-gnu/libpthread.so.0
#2 0x00007ffff73dbf9c in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#3 0x00007ffff78eee1d in clone () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) info threads
  Id Target Id Frame
  37 Thread 0x7fff9408a700 (LWP 9602) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  36 Thread 0x7fff9b6b1700 (LWP 9599) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  35 Thread 0x7fff9448b700 (LWP 9597) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  34 Thread 0x7fff9468c700 (LWP 9596) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  33 Thread 0x7fff94c96700 (LWP 9595) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  30 Thread 0x7fff96f1d700 (LWP 9592) "gdbus" 0x00007ffff74c73cd in poll () from /lib/x86_64-linux-gnu/libc.so.6
  29 Thread 0x7fff9771e700 (LWP 9591) "dconf worker" 0x00007ffff74c73cd in poll ()
   from /lib/x86_64-linux-gnu/libc.so.6
  28 Thread 0x7fffa8295700 (LWP 9590) "java" 0x00007ffff7bcbcbd in read ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  27 Thread 0x7fffa85ad700 (LWP 9589) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  26 Thread 0x7fffa87ae700 (LWP 9588) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  25 Thread 0x7fffa89af700 (LWP 9587) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  24 Thread 0x7fffa8bb0700 (LWP 9586) "java" 0x00007fffe10102a0 in ?? ()
  23 Thread 0x7fffa8db1700 (LWP 9585) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  22 Thread 0x7fffa91b2700 (LWP 9584) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
* 21 Thread 0x7fffa9f20700 (LWP 9582) "java" 0x00007fffa1ee7880 in ?? ()
  20 Thread 0x7fffaa121700 (LWP 9581) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  19 Thread 0x7fffaa522700 (LWP 9580) "java" 0x00007ffff74c73cd in poll () from /lib/x86_64-linux-gnu/libc.so.6
  18 Thread 0x7fffaab34700 (LWP 9579) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  17 Thread 0x7fffab1bf700 (LWP 9578) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  16 Thread 0x7fffab3c0700 (LWP 9577) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  15 Thread 0x7fffab5c1700 (LWP 9576) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  14 Thread 0x7fffd8e82700 (LWP 9575) "java" 0x00007ffff74c73cd in poll () from /lib/x86_64-linux-gnu/libc.so.6
  13 Thread 0x7fffda0e7700 (LWP 9574) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  12 Thread 0x7fffda60f700 (LWP 9573) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  11 Thread 0x7fffda810700 (LWP 9572) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  10 Thread 0x7fffda911700 (LWP 9571) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  9 Thread 0x7fffdaa12700 (LWP 9570) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  8 Thread 0x7fffdac13700 (LWP 9569) "java" 0x00007ffff7bcaf80 in sem_wait ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  7 Thread 0x7fffdb4f5700 (LWP 9568) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  6 Thread 0x7fffdb6f6700 (LWP 9567) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  5 Thread 0x7fffdb7f7700 (LWP 9566) "java" 0x00007ffff7bc905e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  4 Thread 0x7ffff428a700 (LWP 9565) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  3 Thread 0x7ffff438b700 (LWP 9564) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  2 Thread 0x7ffff61e7700 (LWP 9563) "java" 0x00007ffff7bc8ca4 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
  1 Thread 0x7ffff7fe1740 (LWP 9559) "java" 0x00007ffff7bc6218 in pthread_join ()
   from /lib/x86_64-linux-gnu/libpthread.so.0

Testing matrix:

Ubuntu JDK results

12.04 JDK7 OK
12.04 JDK8 OK
13.04 JDK7 OK
13.04 JDK8 CRASH

For reference the command I used to run was: ./netbeans-7.4rc2/bin/netbeans --jdkhome ~/Desktop/work/jdk1.8.0_b108/ -J-Xcheck:jni -J-Xint

You can grab JDK8 from https://jdk8.java.net/archive/index.html
You can grab Netbeans from https://netbeans.org/community/releases/74/

1) 'lsb_release -rd' returns "13.04"
2) 'apt-cache policy pkgname' returns "N: Unable to locate package pkgname"
3) Netbeans to launch without crash
4) Netbeans crashes

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1234253/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
tags: added: raring
Revision history for this message
gerard ziemski (gerard-ziemski) wrote :

It seems that the issue was resolved in Ubuntu 13.10 Beta 2 available from http://releases.ubuntu.com/saucy/

This issue can be now closed.

Changed in ubuntu:
status: New → Fix Released
Revision history for this message
gerard ziemski (gerard-ziemski) wrote :

I'm re-opening this issue as it still exists in the latest 13.10 with the latest NetBeans 7.4 (final) - it crashes about 50% of the time.

Changed in ubuntu:
status: Fix Released → New
Revision history for this message
gerard ziemski (gerard-ziemski) wrote :

A workaround is to change CPU affinity to something low, like 1:

taskset 0x1 ~/Desktop/work/netbeans-7.4/bin/netbeans --jdkhome ~/Desktop/work/jdk1.8.0/ -J-showversion -J-Xcheck:jni -J-Xint

Revision history for this message
Quinn Balazs (qbalazs) wrote :

Bug #1241101 may or may not be relevant here. If it is, the JDK isn't at fault, it seems to be more of a GTK+ Unity Global Menu issue.

Revision history for this message
gerard ziemski (gerard-ziemski) wrote :

I've tried the workarounds from https://bugs.launchpad.net/ubuntu/+source/java-common/+bug/1241101 and unfortunately none of them help. This one seems to be a different issue.

affects: ubuntu → glibc (Ubuntu)
Revision history for this message
gerard ziemski (gerard-ziemski) wrote :

Thread 22 (Thread 0x7fffa87ff700 (LWP 7003)):
#0 0x00007fff8891f320 in ?? ()
#1 0x00007ffff7bc4d72 in __nptl_deallocate_tsd () at pthread_create.c:157
#2 0x00007ffff7bc4f7c in start_thread (arg=0x7fffa87ff700) at pthread_create.c:318
#3 0x00007ffff74d49cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Revision history for this message
gerard ziemski (gerard-ziemski) wrote :

ibpthread.so exists at: /lib/x86_64-linux-gnu/libpthread-2.17.so
debug libpthread.so exists at: /usr/lib/debug/lib/x86_64-linux-gnu/libpthread-2.17.so

According to http://packages.ubuntu.com/saucy/i386/libc6-amd64/filelist libpthread is part of libc6 (ie. [http://archive.ubuntu.com/ubuntu/pool/main/e/eglibc/eglibc_2.17.orig.tar.xz])

The file pthread_create.c:157 shows:

156: /* Call the user-provided destructor. */
157: __pthread_keys[idx].destr (data);

Revision history for this message
gerard ziemski (gerard-ziemski) wrote :

After obtaining eglibc-2.17

    svn co svn://svn.eglibc.org/branches/eglibc-2_17 eglibc-2.17

modifying it to show who calls "pthread_key_create" with non NULL destructor, building it and using it to run the example we get:

>>>>> pthread_key_create pthread: 0x7f0378fdc700, destr: 0x7f034d4ab320
Obtained 20 stack frames.
/home/gerard/Desktop/work/eglibc-2.17/build/nptl/libpthread.so.0(+0xceaa) [0x7f03c3c81eaa]
/home/gerard/Desktop/work/eglibc-2.17/build/nptl/libpthread.so.0(__pthread_key_create+0x47) [0x7f03c3c81f47]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x88301) [0x7f034d4d0301]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_private_get+0x9) [0x7f034d4d0749]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_slice_alloc+0x1d) [0x7f034d4ab94d]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_hash_table_new_full+0x1e) [0x7f034d47fc6e]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_quark_from_static_string+0x105) [0x7f034d49fbc5]
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(+0xb37c) [0x7f034d75437c]
/lib64/ld-linux-x86-64.so.2(+0xf856) [0x7f03c468a856]
/lib64/ld-linux-x86-64.so.2(+0xf910) [0x7f03c468a910]
/lib64/ld-linux-x86-64.so.2(+0x13fdf) [0x7f03c468efdf]
/lib64/ld-linux-x86-64.so.2(+0xf6e6) [0x7f03c468a6e6]
/lib64/ld-linux-x86-64.so.2(+0x13809) [0x7f03c468e809]
/lib/x86_64-linux-gnu/libdl.so.2(+0x1026) [0x7f03c3e93026]
/lib64/ld-linux-x86-64.so.2(+0xf6e6) [0x7f03c468a6e6]
/lib/x86_64-linux-gnu/libdl.so.2(+0x163c) [0x7f03c3e9363c]
/lib/x86_64-linux-gnu/libdl.so.2(dlopen+0x31) [0x7f03c3e930c1]
/home/gerard/Desktop/work/jdks/jdk8/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/libawt_xawt.so(+0x4dd89) [0x7f03a4c1dd89]
/home/gerard/Desktop/work/jdks/jdk8/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/libawt_xawt.so(Java_sun_awt_UNIXToolkit_check_1gtk+0x1a) [0x7f03a4c1912b]
[0x7f03ad0298dc]
>>>>> pthread_key_t: 2

then later when thread 0x7f0378fdc700 goes away:

>>>>> __nptl_deallocate_tsd
>>>>> pthread: 0x7f0378fdc700
>>>>> HERE1
>>>>> data: 0x7f03500008c0
>>>>> __pthread_keys[idx].destr: 0x7f03c3e932c0
>>>>> HERE2
>>>>> HERE1
>>>>> data: 0x7f03500f5700
>>>>> __pthread_keys[idx].destr: 0x7f034d4ab320

which ends in a crash:

# SIGSEGV (0xb) at pc=0x00007f034d4ab320, pid=24055, tid=139652891526912 (0x7F0378FDC700)

We clearly show that the destructor that crashes (i.e. 0x7f034d4ab320) is not created by us, but by Ubuntu itself (ie. g_quark_from_static_string), so this proves it's not Java, but Ubuntu itself who seems responsible.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in glibc (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.