您的位置:首页 > 运维架构 > Tomcat

tomcat自动关闭:A fatal error has been detected by the Java Runtime Environment

2018-01-25 13:28 2241 查看
这两天项目服务器经常自己挂掉,查看了一下日志:

# A fatal error has been detected by the Java Runtime Environment:
#
# SIGBUS (0x7) at pc=0x00007ff185390840, pid=2846, tid=0x00007ff15c8a4700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_144-b01) (build 1.8.0_144-b01)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.144-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libc.so.6+0x14e840] __memmove_ssse3_back+0x50
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /srv/lukistask-tomcat8/bin/hs_err_pid2846.log


根据上面的日志路径,查看了hs_err_pid2846.log:
其中有一段显示了错误的位置:

Stack: [0x00007fc984ffc000,0x00007fc9850fd000], sp=0x00007fc9850fa5f8, free space=1017k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libc.so.6+0x14e840] __memmove_ssse3_back+0x50
j sun.misc.Unsafe.copyMemory(Ljava/lang/Object;JLjava/lang/Object;JJ)V+0
j java.nio.Bits.copyToArray(JLjava/lang/Object;JJJ)V+42
j java.nio.DirectByteBuffer.get([BII)Ljava/nio/ByteBuffer;+98
j com.itextpdf.text.io.ByteBufferRandomAccessSource.get(J[BII)I+66
j com.itextpdf.text.io.MappedChannelRandomAccessSource.get(J[BII)I+27
j com.itextpdf.text.io.FileChannelRandomAccessSource.get(J[BII)I+10
j com.itextpdf.text.io.GetBufferedRandomAccessSource.get(J[BII)I+10
j com.itextpdf.text.io.IndependentRandomAccessSource.get(J[BII)I+10
j com.itextpdf.text.io.IndependentRandomAccessSource.get(J[BII)I+10
j com.itextpdf.text.pdf.RandomAccessFileOrArray.read([BII)I+56
j com.itextpdf.text.pdf.RandomAccessFileOrArray.readFully([BII)V+13
j com.itextpdf.text.pdf.RandomAccessFileOrArray.readFully([B)V+5
j com.itextpdf.text.pdf.PdfReader.getStreamBytesRaw(Lcom/itextpdf/text/pdf/PRStream;Lcom/itextpdf/text/pdf/RandomAccessFileOrArray;)[B+39
j com.itextpdf.text.pdf.PdfReader.getStreamBytesRaw(Lcom/itextpdf/text/pdf/PRStream;)[B+14
j com.itextpdf.text.pdf.PRStream.
4000
toPdf(Lcom/itextpdf/text/pdf/PdfWriter;Ljava/io/OutputStream;)V+1
j com.itextpdf.text.pdf.PdfIndirectObject.writeTo(Ljava/io/OutputStream;)V+50
j com.itextpdf.text.pdf.PdfWriter$PdfBody.write(Lcom/itextpdf/text/pdf/PdfIndirectObject;II)V+55
j com.itextpdf.text.pdf.PdfWriter$PdfBody.add(Lcom/itextpdf/text/pdf/PdfObject;IIZ)Lcom/itextpdf/text/pdf/PdfIndirectObject;+136
j com.itextpdf.text.pdf.PdfWriter.addToBody(Lcom/itextpdf/text/pdf/PdfObject;IZ)Lcom/itextpdf/text/pdf/PdfIndirectObject;+8
j com.itextpdf.text.pdf.PdfStamperImp.close(Lcom/itextpdf/text/pdf/PdfIndirectReference;I)V+241
j com.itextpdf.text.pdf.PdfStamperImp.close(Ljava/util/Map;)V+1402
j com.itextpdf.text.pdf.PdfStamper.close()V+30
j utils.PdfUtils.modifyFilebox(Lcom/itextpdf/text/pdf/PdfReader;Lcom/itextpdf/text/pdf/PdfStamper;FFLutils/handler/design/DesignHandler;)V+267
j utils.PdfUtils.modifys(Lcom/itextpdf/text/pdf/PdfReader;Ljava/util/List;Ljava/io/FileOutputStream;FFLutils/handler/design/DesignHandler;Ljava/lang/Boolean;FLjava/lang/Boolean;)V+554
j com.taskSystem.service.UploadService.modifyPDF()Lutils/container/pdf/DesignBean;+92
j com.taskSystem.service.UploadService.executerTask()Lutils/netty/SocketResponse;+180
j com.taskSystem.service.BaseTaskService.autoExecuter()V+34
j com.taskSystem.service.BaseTaskService.run()V+1
j java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+95
j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5
j java.lang.Thread.run()V+11根据位置发现错误是因为关闭了一个文件流引起的,google了一下错误,发现是jdk的一个bug:
BUG参考资料:点击打开链接

尝试了一下网上给出来的解决方法,设置jdk参数:-XX:-ReduceInitialCardMarks

结果还是没有效果

最终解决方案:

把服务器tomcat引用的jdk改成1.8,项目的jdk也改成1.8

这样就解决问题了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  异常 jdk tomcat
相关文章推荐