使用SIGSEGV的JVM崩溃 - 有问题的框架 - libzip.so

时间:2016-06-27 15:04:51

标签: java tomcat7 java-7

JVM不时发生奇怪的崩溃。 JVM崩溃日志中有问题的框架是libzip.so,错误是SIGSEGV。这发生在Tomcat 7和JDK 7

以下是Stack Trace供参考:

  

Stack:[0x00007f68b999c000,0x00007f68b9a9d000],sp = 0x00007f68b9a99770,

     

可用空间= 1013k本机帧:(J =已编译的Java代码,j =已解释,   Vv = VM代码,C =本机代码)C [libzip.so + 0x8099] deflate_slow + 0x49 C

     

[libzip.so + 0x7433] deflate + 0x163 C [libzip.so + 0x3049]

     

Java_java_util_zip_Deflater_deflateBytes + 0x269 j   java.util.zip.Deflater.deflateBytes(J [BIII] I + 0 J 3307 C2   java.util.zip.GZIPOutputStream.finish()V(135 bytes)@

     

org.apache.coyote.http11.filters.FlushableGZIPOutputStream.finish()V + 9   j org.apache.coyote.http11.filters.GzipOutputFilter.end()J + 26 j   org.apache.coyote.http11.AbstractOutputBuffer.endRequest()V + 43 J 2372   C2

     

org.apache.coyote.http11.AbstractHttp11Processor.action(Lorg /阿帕奇/丛林狼/ ActionCode; Ljava /郎/对象;)V   (602字节)@ 0x00007f6a4d759c84 [0x00007f6a4d759a80 + 0x204] J 2733 C2   org.apache.coyote.Response.action(Lorg /阿帕奇/丛林狼/ ActionCode; Ljava /郎/对象;)V

     

(37字节)@ 0x00007f6a4d8b9ad0 [0x00007f6a4d8b9a80 + 0x50] j   org.apache.coyote.Response.finish()V + 5 j   org.apache.catalina.connector.OutputBuffer.close()V + 138 j   org.apache.catalina.connector.CoyoteWriter.close()V + 4 j   org.apache.catalina.core.ApplicationDispatcher.doForward(Ljavax / servlet的/ ServletRequest中; Ljavax / servlet的/ ServletResponse的;)V + 467   Ĵ   org.apache.catalina.core.ApplicationDispatcher.forward(Ljavax / servlet的/ ServletRequest中; Ljavax / servlet的/ ServletResponse的;)V + 55   Ĵ   org.apache.struts.action.RequestProcessor.doForward(Ljava /郎/字符串; Ljavax / servlet的/ HTTP / HttpServletRequest的; Ljavax / servlet的/ HTTP / HttpServletResponse的;)V + 56   Ĵ   org.apache.struts.tiles.TilesRequestProcessor.doForward(Ljava /郎/字符串; Ljavax / servlet的/ HTTP / HttpServletRequest的; Ljavax / servlet的/ HTTP / HttpServletResponse的;)V + 23   Ĵ   org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(Ljava /郎/字符串; ZLjavax / servlet的/ HTTP / HttpServletRequest的; Ljavax / servlet的/ HTTP / HttpServletResponse的;)Z + 385   Ĵ   org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Ljavax / servlet的/ HTTP / HttpServletRequest的; Ljavax / servlet的/ HTTP / HttpServletResponse的; Lorg /阿帕奇/支柱/配置/ ForwardConfig;)V + 74   Ĵ   org.apache.struts.action.RequestProcessor.process(Ljavax / servlet的/ HTTP / HttpServletRequest的; Ljavax / servlet的/ HTTP / HttpServletResponse的;)V + 267   Ĵ   org.apache.struts.action.ActionServlet.process(Ljavax / servlet的/ HTTP / HttpServletRequest的; Ljavax / servlet的/ HTTP / HttpServletResponse的;)V + 40   Ĵ   org.apache.struts.action.ActionServlet.doGet(Ljavax / servlet的/ HTTP / HttpServletRequest的; Ljavax / servlet的/ HTTP / HttpServletResponse的;)V + 3   Ĵ   javax.servlet.http.HttpServlet.service(Ljavax / servlet的/ HTTP / HttpServletRequest的; Ljavax / servlet的/ HTTP / HttpServletResponse的;)V + 35   Ĵ   javax.servlet.http.HttpServlet.service(Ljavax / servlet的/ ServletRequest中; Ljavax / servlet的/ ServletResponse的;)V + 30   J 2406 C2   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax / servlet的/ ServletRequest中; Ljavax / servlet的/ ServletResponse的;)V   (624字节)@ 0x00007f6a4d7760e4 [0x00007f6a4d775da0 + 0x344] J 2407 C2   org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax / servlet的/ ServletRequest中; Ljavax / servlet的/ ServletResponse的;)V   (105字节)@ 0x00007f6a4d5b2154 [0x00007f6a4d5b2120 + 0x34] j   org.apache.tomcat.websocket.server.WsFilter.doFilter(Ljavax / servlet的/ ServletRequest中; Ljavax / servlet的/ ServletResponse的; Ljavax / servlet的/ FilterChain;)V + 21   J 2406 C2   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax / servlet的/ ServletRequest中; Ljavax / servlet的/ ServletResponse的;)V   (624字节)@ 0x00007f6a4d775f28 [0x00007f6a4d775da0 + 0x188] J 2407 C2   org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax / servlet的/ ServletRequest中; Ljavax / servlet的/ ServletResponse的;)V   (105字节)@ 0x00007f6a4d5b2154 [0x00007f6a4d5b2120 + 0x34] j   org.apache.catalina.core.ApplicationDispatcher.invoke(Ljavax / servlet的/ ServletRequest中; Ljavax / servlet的/ ServletResponse的; Lorg /阿帕奇/卡塔利娜/型芯/ ApplicationDispatcher $国家;)V + 393   j

     
    

org.apache.catalina.core.ApplicationDispatcher.processRequest(Ljavax / servlet的/ ServletRequest中; Ljavax / servlet的/ ServletResponse的; Lorg /阿帕奇/卡塔利娜/型芯/ ApplicationDispatcher $国家;)V + 98

  

仅在迁移到JDK 7 + Tomcat7之后才会出现此问题。它在较低版本中运行良好。非常感谢任何帮助。

2 个答案:

答案 0 :(得分:0)

由于堆栈跟踪中存在jni调用,请尝试使用-Xcheck:jni选项运行jvm(我不确定它是否会在您的情况下检测到某些错误)。

在tomcat过滤器中压缩输出流时发生此崩溃。您可以在连接器(here

中禁用压缩

同样如我所见,deflate_slow方法出错,您可以关闭tomcat GzipOutputFilter并使用DeflaterOutputStream创建自定义过滤器并将压缩级别设置为1-3(在这种情况下deflate_fast方法将在热点中选择)

答案 1 :(得分:0)

请使用-Dsun.zip.disableMemoryMapping = true来避免此类崩溃,JDK9有更好的机制来处理此类崩溃。如果可行,请升级到使用JDK9