Crash due to missing synchronization on 'gconf_client' in 'jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c' (original) (raw)

David Holmes david.holmes at oracle.com
Thu Aug 2 07:44:24 PDT 2012


Hi Christian,

Probably best to discuss this on the net-dev at openjdk.java.net list (cc'd).

Two comments from me (I'm not on net-dev):

  1. CHECK_NULL does a return so you will be leaving the monitor locked if you encounter any nulls.

  2. Is it simpler to add synchronization at the Java level? (I don't know how this code is used)

David Holmes

On 2/08/2012 8:54 PM, Christian Schulte wrote:

Hi,

using the system property 'java.net.useSystemProxies', JDK 7 crashes on OpenBSD 5.2. $ /usr/local/jre-1.7.0/bin/java -version openjdk version "1.7.003" OpenJDK Runtime Environment (build 1.7.003-b04) OpenJDK Server VM (build 22.1-b02, mixed mode) $ /usr/local/jre-1.7.0/bin/java -cp . Crash 2538: assertion failed "allocator->lockloc == NULL" file "/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79 function dbusdataslotallocatoralloc 2538: assertion failed "allocator->lockloc == NULL" file "/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79 function dbusdataslotallocatoralloc 2538: assertion failed "allocator->lockloc == NULL" file "/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79 function dbusdataslotallocatoralloc 2538: assertion failed "allocator->lockloc == NULL" file "/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79 function dbusdataslotallocatoralloc D-Bus not compiled with backtrace support so unable to print a backtrace D-Bus not compiled with backtrace support so unable to print a backtrace $ /usr/local/jre-1.7.0/bin/java -cp . Crash 27421: assertion failed "!(connection)->haveconnectionlock" file "/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-connection.c" line 1133 function dbusconnectionacquireiopath D-Bus not compiled with backtrace support so unable to print a backtrace Abort trap (core dumped) Looking at 'openjdk/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c', there is a 'static void* gconfclient' which is initialized by calling 'gconfclientgetdefault' from 'libgconf-2'. Uses of that client are not protected against concurrent accesses by multiple threads although that gconf client is not thread-safe. Trying to add some protection myself resulted in the attached patch. Rebuilding JDK 1.7 with this patch applied, the 'gconf'/'dbus' related crashes no longer happen. Regards,



More information about the jdk7u-dev mailing list