在 Debian Squeeze 上由 libdbus 引起的 glassfish 崩溃

发布于 2025-01-05 07:14:21 字数 2390 浏览 2 评论 0原文

我正在 Linux debian Squeez (6.0.4) 上使用 java build 1.6.0_29-b11 运行 glassfish v3.1.1 build 12。 我正在运行一个正在调用外部肥皂网络服务的网络应用程序。

jvm 时不时就会崩溃。我可以通过同时执行 20 个线程来重现此崩溃。

hs_err_pid 故障转储文件显示 libdbus 是有问题的库。这是崩溃转储中有趣的部分

 Stack: [0x00007f3fef0ff000,0x00007f3fef200000],  sp=0x00007f3fef1f7058,  free space=992k
 Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
 C  [libdbus-1.so.3+0x28de0]

 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
 j  sun.net.spi.DefaultProxySelector.getSystemProxy(Ljava/lang/String;Ljava/lang/String;)Ljava/net/Proxy;+0
 j  sun.net.spi.DefaultProxySelector.access$100(Lsun/net/spi/DefaultProxySelector;Ljava/lang/String;Ljava/lang/String;)Ljava/net/Proxy;+3
 j  sun.net.spi.DefaultProxySelector$2.run()Ljava/lang/Object;+151
 v  ~StubRoutines::call_stub
 J  java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;)Ljava/lang/Object;
 j  sun.net.spi.DefaultProxySelector.select(Ljava/net/URI;)Ljava/util/List;+273
 j  sun.net.www.protocol.http.HttpURLConnection.plainConnect()V+187
 j  sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect()V+9
 j  sun.net.www.protocol.http.HttpURLConnection.getOutputStream()Ljava/io/OutputStream;+134
 j  sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream()Ljava/io/OutputStream;+4
 j  com.sun.xml.ws.mex.client.HttpPoster.post(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/io/InputStream;+60

,您可以看到实际的 HttpPoster.post 正在被调用,然后崩溃发生了。 sun.net.spi.DefaultProxySelector 是 rt.jar 的一部分,因此它是默认 jvm 安装的一部分。

我尝试了jdk7,但也发生了崩溃。

然后我安装了openjdk,它也崩溃了。

然后我安装了dbus-java,它是dbus的java实现(使用apt-get)。通常,仅当某些 jar 文件显式放置在路径中时才会使用此库。但安装这个库后,崩溃就不再发生了。所以看起来 openjdk 正在使用这个库(假设)

我与 dbus-java 的维护者交谈过,而且他也不知道 sun jdk 或 openjdk 正在使用 dbus。所以我们俩都很困惑。

崩溃不再发生,但现在 glassfish 的管理界面停止工作。谷歌搜索显示这是一个已知问题,解决方案是开始使用sun jdk。啊啊。

您以前见过这个问题吗?有解决办法吗?

更新:

DefaultProxySelector.getSystemProperty 方法是调用本机方法之前调用的最后一个方法。查看 DefaultProxySelector 的代码,我发现只有当 java.net.useSystemProxies=true 时才应调用此方法。但该属性未设置(jvm 设置中没有 -D 设置),$JAVA_HOME/jre/lib/net.properties 文件中也不是这样。但调试后显示这个布尔值是真的。

所以现在最大的问题是:为什么这个布尔值是真的?

更新2:

该问题是由updatetool 配置引起的。有关详细信息,请参阅错误报告 GLASSFISH-18360

I'm running glassfish v3.1.1 build 12 using java build 1.6.0_29-b11 on linux debian squeez (6.0.4).
I'm running a webapp which is calling an external soap webservice.

Every now and then the jvm crashes. I can reproduce this crash by executing 20 threads simultaneously.

The hs_err_pid crash dump file shows that libdbus is the problematic library. Here's the interesting part of the crash dump

 Stack: [0x00007f3fef0ff000,0x00007f3fef200000],  sp=0x00007f3fef1f7058,  free space=992k
 Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
 C  [libdbus-1.so.3+0x28de0]

 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
 j  sun.net.spi.DefaultProxySelector.getSystemProxy(Ljava/lang/String;Ljava/lang/String;)Ljava/net/Proxy;+0
 j  sun.net.spi.DefaultProxySelector.access$100(Lsun/net/spi/DefaultProxySelector;Ljava/lang/String;Ljava/lang/String;)Ljava/net/Proxy;+3
 j  sun.net.spi.DefaultProxySelector$2.run()Ljava/lang/Object;+151
 v  ~StubRoutines::call_stub
 J  java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;)Ljava/lang/Object;
 j  sun.net.spi.DefaultProxySelector.select(Ljava/net/URI;)Ljava/util/List;+273
 j  sun.net.www.protocol.http.HttpURLConnection.plainConnect()V+187
 j  sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect()V+9
 j  sun.net.www.protocol.http.HttpURLConnection.getOutputStream()Ljava/io/OutputStream;+134
 j  sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream()Ljava/io/OutputStream;+4
 j  com.sun.xml.ws.mex.client.HttpPoster.post(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/io/InputStream;+60

as you can see the actual HttpPoster.post is being called after which the crash occurs. The sun.net.spi.DefaultProxySelector is part of rt.jar so this is part of the default jvm installation.

I tried jdk7 but also here the crash occurs.

Then I installed openjdk which also crashed.

Then I installed dbus-java which is the java implementation of dbus (using apt-get). Normally this library is only used when certain jar files are put explicitly in the path. But after installing this library the crashes don't occur anymore. So it looks like openjdk is using this library (assumption)

I talked to the maintainer of dbus-java and also he is not aware that sun jdk or openjdk is using dbus. So we are both quite confused.

The crashes don't occur anymore but now the admin interface of glassfish stops working. Googling shows that this is a known issue and the solution is to start using sun jdk. Aaargh.

Have you seen this problem before? Is there a solution?

UPDATE:

the DefaultProxySelector.getSystemProperty method is the last method that is called before a native method is called. Looking at the code of DefaultProxySelector I found that this method should only be called if the java.net.useSystemProxies=true. But this property is not set (no -D setting in the jvm settings) nor is it true in the $JAVA_HOME/jre/lib/net.properties file. But after debugging it shows this boolean IS true.

So the big question now is : why is this boolean true?

UPDATE 2:

The problem was caused by the updatetool configuration. See bug report GLASSFISH-18360 for details.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文