Re: Crash due to missing synchronization on 'gconf_client' in 'jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c'

2012-08-02 Thread Christian Schulte

Am 08/02/12 17:27, schrieb Chris Hegarty:

Thanks for the cross post David. Yes, net-dev is the best place to
discuss this issue ( bcc'ing off jdk7u-dev ).

Thanks for reporting this issue Christian. I haven't looked at the
proposed patch yet, but I agree we may want to simplify this if possible
( handling the synchronization at the Java level ). We also need to add
support for gnome3 system proxies in the near future. We need to ensure
we don't further complicate that.


The attached patch moves synchronization to the Java level for all 
platforms and also solves the issue here.


Regards,

--
Christian
--- jdk/src/share/classes/sun/net/spi/DefaultProxySelector.java.origFri Aug 
 3 06:05:21 2012
+++ jdk/src/share/classes/sun/net/spi/DefaultProxySelector.java Fri Aug  3 
06:05:37 2012
@@ -339,6 +339,6 @@ public class DefaultProxySelector extends ProxySelecto
 }
 }
 
-private native static boolean init();
-private native Proxy getSystemProxy(String protocol, String host);
+private synchronized native static boolean init();
+private synchronized native Proxy getSystemProxy(String protocol, String 
host);
 }


hg: jdk8/tl/jdk: 7187876: ClassCastException in TCPTransport.executeAcceptLoop

2012-08-02 Thread stuart . marks
Changeset: 8a82e5f9c47f
Author:dmocek
Date:  2012-08-02 18:12 -0700
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8a82e5f9c47f

7187876: ClassCastException in TCPTransport.executeAcceptLoop
Reviewed-by: dholmes, smarks

! src/share/classes/sun/rmi/transport/tcp/TCPTransport.java



Re: Crash due to missing synchronization on 'gconf_client' in 'jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c'

2012-08-02 Thread Andrew Hughes
- Original Message -
> Thanks for the cross post David. Yes, net-dev is the best place to
> discuss this issue ( bcc'ing off jdk7u-dev ).
> 
> Thanks for reporting this issue Christian. I haven't looked at the
> proposed patch yet, but I agree we may want to simplify this if
> possible
> ( handling the synchronization at the Java level ). We also need to
> add
> support for gnome3 system proxies in the near future. We need to
> ensure
> we don't further complicate that.
> 

We already have support for GNOME3 system proxies (now actually
at the Glib level) in IcedTea and I intend to post an upstream version
of this in the next few weeks.

> I filed CR 7188755: "Crash due to missing synchronization on
> gconf_client in DefaultProxySelector.c", to track this issue.
> 
> -Chris.
> 
> 
> 
> On 02/08/12 15:44, David Holmes wrote:
> > Hi Christian,
> >
> > Probably best to discuss this on the net-dev@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.0_03"
> >> OpenJDK Runtime Environment (build 1.7.0_03-b04)
> >> OpenJDK Server VM (build 22.1-b02, mixed mode)
> >>
> >> $ /usr/local/jre-1.7.0/bin/java -cp . Crash
> >> 2538: assertion failed "allocator->lock_loc == NULL" file
> >> "/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line
> >> 79
> >> function _dbus_data_slot_allocator_alloc
> >> 2538: assertion failed "allocator->lock_loc == NULL" file
> >> "/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line
> >> 79
> >> function _dbus_data_slot_allocator_alloc
> >> 2538: assertion failed "allocator->lock_loc == NULL" file
> >> "/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line
> >> 79
> >> function _dbus_data_slot_allocator_alloc
> >> 2538: assertion failed "allocator->lock_loc == NULL" file
> >> "/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line
> >> 79
> >> function _dbus_data_slot_allocator_alloc
> >> 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)->have_connection_lock" file
> >> "/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-connection.c"
> >> line 1133
> >> function _dbus_connection_acquire_io_path
> >> 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* gconf_client' which is initialized by
> >> calling
> >> 'gconf_client_get_default' 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,
> >>
> 

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07



Re: Crash due to missing synchronization on 'gconf_client' in 'jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c'

2012-08-02 Thread Chris Hegarty
Thanks for the cross post David. Yes, net-dev is the best place to 
discuss this issue ( bcc'ing off jdk7u-dev ).


Thanks for reporting this issue Christian. I haven't looked at the 
proposed patch yet, but I agree we may want to simplify this if possible 
( handling the synchronization at the Java level ). We also need to add 
support for gnome3 system proxies in the near future. We need to ensure 
we don't further complicate that.


I filed CR 7188755: "Crash due to missing synchronization on 
gconf_client in DefaultProxySelector.c", to track this issue.


-Chris.



On 02/08/12 15:44, David Holmes wrote:

Hi Christian,

Probably best to discuss this on the net-dev@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.0_03"
OpenJDK Runtime Environment (build 1.7.0_03-b04)
OpenJDK Server VM (build 22.1-b02, mixed mode)

$ /usr/local/jre-1.7.0/bin/java -cp . Crash
2538: assertion failed "allocator->lock_loc == NULL" file
"/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79
function _dbus_data_slot_allocator_alloc
2538: assertion failed "allocator->lock_loc == NULL" file
"/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79
function _dbus_data_slot_allocator_alloc
2538: assertion failed "allocator->lock_loc == NULL" file
"/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79
function _dbus_data_slot_allocator_alloc
2538: assertion failed "allocator->lock_loc == NULL" file
"/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79
function _dbus_data_slot_allocator_alloc
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)->have_connection_lock" file
"/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-connection.c" line 1133
function _dbus_connection_acquire_io_path
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* gconf_client' which is initialized by calling
'gconf_client_get_default' 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,



Re: Crash due to missing synchronization on 'gconf_client' in 'jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c'

2012-08-02 Thread David Holmes

Hi Christian,

Probably best to discuss this on the net-dev@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.0_03"
OpenJDK Runtime Environment (build 1.7.0_03-b04)
OpenJDK Server VM (build 22.1-b02, mixed mode)

$ /usr/local/jre-1.7.0/bin/java -cp . Crash
2538: assertion failed "allocator->lock_loc == NULL" file
"/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79
function _dbus_data_slot_allocator_alloc
2538: assertion failed "allocator->lock_loc == NULL" file
"/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79
function _dbus_data_slot_allocator_alloc
2538: assertion failed "allocator->lock_loc == NULL" file
"/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79
function _dbus_data_slot_allocator_alloc
2538: assertion failed "allocator->lock_loc == NULL" file
"/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-dataslot.c" line 79
function _dbus_data_slot_allocator_alloc
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)->have_connection_lock" file
"/usr/ports/pobj/dbus-1.6.2/dbus-1.6.2/dbus/dbus-connection.c" line 1133
function _dbus_connection_acquire_io_path
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* gconf_client' which is initialized by calling
'gconf_client_get_default' 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,



hg: jdk8/tl/jdk: 2 new changesets

2012-08-02 Thread sean . mullan
Changeset: b0bfa441d70f
Author:mullan
Date:  2012-08-02 10:40 -0400
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b0bfa441d70f

7026347: Certificate and X509CRL should have verify(PublicKey key, Provider 
sigProvider)
Reviewed-by: mullan, xuelei, weijun
Contributed-by: jason...@oracle.com

! src/share/classes/java/security/cert/Certificate.java
! src/share/classes/java/security/cert/X509CRL.java
! src/share/classes/java/security/cert/X509Certificate.java
! src/share/classes/sun/security/x509/X509CRLImpl.java
! src/share/classes/sun/security/x509/X509CertImpl.java
+ test/sun/security/x509/X509CRLImpl/Verify.java
+ test/sun/security/x509/X509CertImpl/Verify.java

Changeset: 4e8bafdcefda
Author:mullan
Date:  2012-08-02 10:42 -0400
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4e8bafdcefda

Merge