Attached is a simple wrapper that can be used to replace the default proxy selector, to eliminate the random crashes.
How to use: simply replace the default proxy selector as soon as possible in your application code:
ProxySelector defaultProxySelector = ProxySelector.getDefault();
if (defaultProxySelector!=null) ProxySelector.setDefault(new ProxySelectorWrapper(defaultProxySelector));
Details: making the select() method synchronized eliminates the possibility to concurrently access the MT-unsafe 'gconf_client' which is used in the native method sun.net.spi.DefaultProxySelector.getSystemProxy() (which in turn is called by DefaultProxySelector.select() when property java.net.useSystemProxies is set to true).
Attached is a simple wrapper that can be used to replace the default proxy selector, to eliminate the random crashes.
How to use: simply replace the default proxy selector as soon as possible in your application code:
ProxySelector defaultProxySel ector = ProxySelector. getDefault( ); lector! =null)
ProxySelector. setDefault( new ProxySelectorWr apper(defaultPr oxySelector) );
if (defaultProxySe
Details: making the select() method synchronized eliminates the possibility to concurrently access the MT-unsafe 'gconf_client' which is used in the native method sun.net. spi.DefaultProx ySelector. getSystemProxy( ) (which in turn is called by DefaultProxySel ector.select( ) when property java.net. useSystemProxie s is set to true).
See: bugs.sun. com/bugdatabase /view_bug. do?bug_ id=7188755 mail.openjdk. java.net/ pipermail/ jdk7u-dev/ 2012-August/ 003911. html jdk/src/ solaris/ native/ sun/net/ spi/DefaultProx ySelector. c jdk/src/ share/classes/ sun/net/ spi/DefaultProx ySelector. java
- http://
- http://
- openjdk/
- openjdk/