JVM 在使用 r5 加载 network.dat 时崩溃
JVM crash on loading network.dat using r5
我正在使用一个名为 R5 的库。它有一个主要方法 com.conveyal.r5.R5Main
将其作为服务启动。它工作得很好。但是当我尝试在我的应用程序中将它用作库并调用相同的流程时,JVM 崩溃并在控制台上打印以下痕迹。
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fd2945622d4, pid=20894, tid=0x00007fd29595b700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x7fe2d4]
#
# 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:
# /home/user/workspace/r5-project/hs_err_pid20894.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
我的项目pom.xml
是:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.playground.r5</groupId>
<artifactId>r5-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>r5-project</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.conveyal</groupId>
<artifactId>r5</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
</project>
崩溃的代码是:
String dir = "/home/user/r5/portland";
File file = new File(dir, "network.dat");
TransportNetwork transportNetwork = TransportNetwork.read(file);
它提到的文件hs_err_pid20894.log
的内容是:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fd2945622d4, pid=20894, tid=0x00007fd29595b700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x7fe2d4]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x00007fd28c013800): JavaThread "main" [_thread_in_vm, id=20901, stack(0x00007fd29585b000,0x00007fd29595c000)]
siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x00007fd22c021000
Registers:
RAX=0x00007fd2840a6264, RBX=0x00007fd28c013800, RCX=0x00000006db82e378, RDX=0xfffffffff4fef5b4
RSP=0x00007fd295959eb8, RBP=0x00007fd295959f10, RSI=0x0000000000000000, RDI=0x00007fd229a8ed0c
R8 =0x000000002d30bab3, R9 =0x0000000000000010, R10=0x00007fd27d01fc78, R11=0x00007fd294729190
R12=0x0000000000000000, R13=0x00007fd295959fe8, R14=0x00007fd294d25f40, R15=0x00007fd294d2acc0
RIP=0x00007fd2945622d4, EFLAGS=0x0000000000010286, CSGSFS=0x0000000000000033, ERR=0x0000000000000004
TRAPNO=0x000000000000000e
Top of Stack: (sp=0x00007fd295959eb8)
0x00007fd295959eb8: 00007fd2947ff2af 0000000000000010
0x00007fd295959ec8: 00007fd229a8ed0c 00007fd28c013800
0x00007fd295959ed8: 00007fd200000000 00007fd295959fa8
0x00007fd295959ee8: 00007fd272880dc8 0000000000000000
0x00007fd295959ef8: 00007fd272880dc8 00007fd29595a008
0x00007fd295959f08: 00007fd28c013800 00007fd295959fa8
0x00007fd295959f18: 00007fd27d01fca4 000000005a617566
0x00007fd295959f28: 00007fd295959f80 00007fd28c013800
0x00007fd295959f38: 00007fd295959f90 00007fd272880dc8
0x00007fd295959f48: 0000000000000000 00007fd295959fa8
0x00007fd295959f58: 00007fd27d01f8bb 00007fd27d01f879
0x00007fd295959f68: 00007fd295959f68 00007fd272880dc8
0x00007fd295959f78: 00007fd29595a008 00007fd2728aed80
0x00007fd295959f88: 0000000000000000 00007fd272880dc8
0x00007fd295959f98: 0000000000000000 00007fd295959fc8
0x00007fd295959fa8: 00007fd29595a050 00007fd27d00833d
0x00007fd295959fb8: 0000000000000000 00007fd27d016478
0x00007fd295959fc8: 000000005a617566 00007fd29595a050
0x00007fd295959fd8: 0000000000000010 00000007559d0c70
0x00007fd295959fe8: 0000000681216e10 00007fd229a8ed0c
0x00007fd295959ff8: 00007fd27d018dd2 0000000000000000
0x00007fd29595a008: 00000007594b3ee0 00007fd29595a010
0x00007fd29595a018: 00007fd272e0c106 00007fd29595a0a8
0x00007fd29595a028: 00007fd272e0db08 0000000000000000
0x00007fd29595a038: 00007fd272e0c198 00007fd295959fc8
0x00007fd29595a048: 00007fd29595a070 00007fd29595a0f0
0x00007fd29595a058: 00007fd27d00833d 0000000000000000
0x00007fd29595a068: 00000007559d0c70 000000005a617566
0x00007fd29595a078: 00007fd200000000 0000000001b8ed0c
0x00007fd29595a088: 0000000000000000 0000000000000000
0x00007fd29595a098: 00007fd27d018dd2 00000007559d0c70
0x00007fd29595a0a8: 0000000759487a20 00007fd29595a0b0
Instructions: (pc=0x00007fd2945622d4)
0x00007fd2945622b4: 74 47 fe 66 89 71 08 c3 0f 1f 40 00 48 8b 74 d0
0x00007fd2945622c4: e8 48 89 74 d1 e8 48 8b 74 d0 f0 48 89 74 d1 f0
0x00007fd2945622d4: 48 8b 74 d0 f8 48 89 74 d1 f8 48 8b 34 d0 48 89
0x00007fd2945622e4: 34 d1 48 83 c2 04 7e d4 48 83 ea 04 7c 93 eb a1
Register to memory mapping:
RAX=0x00007fd2840a6264 is an unknown value
RBX=0x00007fd28c013800 is a thread
RCX=0x00000006db82e378 is pointing into object: 0x0000000681216e10
[B
- klass: {type array byte}
- length: 1516336486
RDX=0xfffffffff4fef5b4 is an unknown value
RSP=0x00007fd295959eb8 is pointing into the stack for thread: 0x00007fd28c013800
RBP=0x00007fd295959f10 is pointing into the stack for thread: 0x00007fd28c013800
RSI=0x0000000000000000 is an unknown value
RDI=0x00007fd229a8ed0c is an unknown value
R8 =0x000000002d30bab3 is an unknown value
R9 =0x0000000000000010 is an unknown value
R10=0x00007fd27d01fc78 is at code_begin+1528 in an Interpreter codelet
method entry point (kind = native) [0x00007fd27d01f680, 0x00007fd27d0205c0] 3904 bytes
R11=0x00007fd294729190: <offset 0x9c5190> in /usr/lib/jvm/java-8-oracle/jre/lib/amd64/server/libjvm.so at 0x00007fd293d64000
R12=0x0000000000000000 is an unknown value
R13=0x00007fd295959fe8 is pointing into the stack for thread: 0x00007fd28c013800
R14=0x00007fd294d25f40: <offset 0xfc1f40> in /usr/lib/jvm/java-8-oracle/jre/lib/amd64/server/libjvm.so at 0x00007fd293d64000
R15=0x00007fd294d2acc0: <offset 0xfc6cc0> in /usr/lib/jvm/java-8-oracle/jre/lib/amd64/server/libjvm.so at 0x00007fd293d64000
Stack: [0x00007fd29585b000,0x00007fd29595c000], sp=0x00007fd295959eb8, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x7fe2d4]
j sun.misc.Unsafe.copyMemory(Ljava/lang/Object;JLjava/lang/Object;JJ)V+0
j org.nustaq.offheap.bytez.malloc.MallocBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+38
j com.conveyal.r5.util.ExpandingMMFBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+20
j org.nustaq.serialization.coders.FSTBytezDecoder.readStringAsc()Ljava/lang/String;+60
j org.nustaq.serialization.FSTClazzNameRegistry.decodeClass(Lorg/nustaq/serialization/FSTDecoder;Lorg/nustaq/serialization/FSTConfiguration;)Lorg/nustaq/serialization/FSTClazzInfo;+28
j org.nustaq.serialization.coders.FSTBytezDecoder.readClass()Lorg/nustaq/serialization/FSTClazzInfo;+9
j org.nustaq.serialization.FSTObjectInput.readClass()Lorg/nustaq/serialization/FSTClazzInfo;+4
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+28
j org.nustaq.serialization.FSTObjectInput.readObjectFields(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Lorg/nustaq/serialization/FSTClazzInfo;[Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Ljava/lang/Object;II)V+491
j org.nustaq.serialization.FSTObjectInput.instantiateAndReadNoSer(Ljava/lang/Class;Lorg/nustaq/serialization/FSTClazzInfo;Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;I)Ljava/lang/Object;+266
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+172
j org.nustaq.serialization.FSTObjectInput.readObjectFields(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Lorg/nustaq/serialization/FSTClazzInfo;[Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Ljava/lang/Object;II)V+491
j org.nustaq.serialization.FSTObjectInput.instantiateAndReadNoSer(Ljava/lang/Class;Lorg/nustaq/serialization/FSTClazzInfo;Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;I)Ljava/lang/Object;+266
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+172
j org.nustaq.serialization.FSTObjectInput.readObjectInternal([Ljava/lang/Class;)Ljava/lang/Object;+38
j org.nustaq.serialization.FSTObjectInput.readObject([Ljava/lang/Class;)Ljava/lang/Object;+63
j com.conveyal.r5.util.ExpandingMMFBytez.readObjectFromFile(Ljava/io/File;)Ljava/lang/Object;+38
j com.conveyal.r5.transit.TransportNetwork.read(Ljava/io/File;)Lcom/conveyal/r5/transit/TransportNetwork;+11
j org.playground.otp.otp.R5App.main([Ljava/lang/String;)V+15
v ~StubRoutines::call_stub
V [libjvm.so+0x691d16]
V [libjvm.so+0x6d3132]
V [libjvm.so+0x6ef99a]
C [libjli.so+0x7bdf] JavaMain+0x81f
C [libpthread.so.0+0x76ba] start_thread+0xca
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j sun.misc.Unsafe.copyMemory(Ljava/lang/Object;JLjava/lang/Object;JJ)V+0
j org.nustaq.offheap.bytez.malloc.MallocBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+38
j com.conveyal.r5.util.ExpandingMMFBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+20
j org.nustaq.serialization.coders.FSTBytezDecoder.readStringAsc()Ljava/lang/String;+60
j org.nustaq.serialization.FSTClazzNameRegistry.decodeClass(Lorg/nustaq/serialization/FSTDecoder;Lorg/nustaq/serialization/FSTConfiguration;)Lorg/nustaq/serialization/FSTClazzInfo;+28
j org.nustaq.serialization.coders.FSTBytezDecoder.readClass()Lorg/nustaq/serialization/FSTClazzInfo;+9
j org.nustaq.serialization.FSTObjectInput.readClass()Lorg/nustaq/serialization/FSTClazzInfo;+4
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+28
j org.nustaq.serialization.FSTObjectInput.readObjectFields(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Lorg/nustaq/serialization/FSTClazzInfo;[Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Ljava/lang/Object;II)V+491
j org.nustaq.serialization.FSTObjectInput.instantiateAndReadNoSer(Ljava/lang/Class;Lorg/nustaq/serialization/FSTClazzInfo;Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;I)Ljava/lang/Object;+266
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+172
j org.nustaq.serialization.FSTObjectInput.readObjectFields(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Lorg/nustaq/serialization/FSTClazzInfo;[Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Ljava/lang/Object;II)V+491
j org.nustaq.serialization.FSTObjectInput.instantiateAndReadNoSer(Ljava/lang/Class;Lorg/nustaq/serialization/FSTClazzInfo;Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;I)Ljava/lang/Object;+266
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+172
j org.nustaq.serialization.FSTObjectInput.readObjectInternal([Ljava/lang/Class;)Ljava/lang/Object;+38
j org.nustaq.serialization.FSTObjectInput.readObject([Ljava/lang/Class;)Ljava/lang/Object;+63
j com.conveyal.r5.util.ExpandingMMFBytez.readObjectFromFile(Ljava/io/File;)Ljava/lang/Object;+38
j com.conveyal.r5.transit.TransportNetwork.read(Ljava/io/File;)Lcom/conveyal/r5/transit/TransportNetwork;+11
j org.playground.otp.otp.R5App.main([Ljava/lang/String;)V+15
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x00007fd28c0f8000 JavaThread "Service Thread" daemon [_thread_blocked, id=20924, stack(0x00007fd2708b4000,0x00007fd2709b5000)]
0x00007fd28c0da800 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=20923, stack(0x00007fd2709b5000,0x00007fd270ab6000)]
0x00007fd28c0d8800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=20922, stack(0x00007fd270ab6000,0x00007fd270bb7000)]
0x00007fd28c0d5800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=20921, stack(0x00007fd270bb7000,0x00007fd270cb8000)]
0x00007fd250001000 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=20917, stack(0x00007fd270cb8000,0x00007fd270db9000)]
0x00007fd28c0d3800 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=20916, stack(0x00007fd270db9000,0x00007fd270eba000)]
0x00007fd28c0d0000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=20915, stack(0x00007fd270eba000,0x00007fd270fbb000)]
0x00007fd28c0bf800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=20911, stack(0x00007fd2711bf000,0x00007fd2712c0000)]
0x00007fd28c08d800 JavaThread "Finalizer" daemon [_thread_blocked, id=20908, stack(0x00007fd2712c0000,0x00007fd2713c1000)]
0x00007fd28c089000 JavaThread "Reference Handler" daemon [_thread_blocked, id=20907, stack(0x00007fd2713c1000,0x00007fd2714c2000)]
=>0x00007fd28c013800 JavaThread "main" [_thread_in_vm, id=20901, stack(0x00007fd29585b000,0x00007fd29595c000)]
Other Threads:
0x00007fd28c081800 VMThread [stack: 0x00007fd2714c2000,0x00007fd2715c3000] [id=20906]
0x00007fd28c10b000 WatcherThread [stack: 0x00007fd2707b3000,0x00007fd2708b4000] [id=20925]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap:
PSYoungGen total 74752K, used 27738K [0x0000000755580000, 0x000000075a880000, 0x00000007c0000000)
eden space 64512K, 27% used [0x0000000755580000,0x000000075669c2f0,0x0000000759480000)
from space 10240K, 99% used [0x0000000759480000,0x0000000759e7a740,0x0000000759e80000)
to space 10240K, 0% used [0x0000000759e80000,0x0000000759e80000,0x000000075a880000)
ParOldGen total 1652224K, used 1499320K [0x0000000680000000, 0x00000006e4d80000, 0x0000000755580000)
object space 1652224K, 90% used [0x0000000680000000,0x00000006db82e388,0x00000006e4d80000)
Metaspace used 9358K, capacity 9604K, committed 9728K, reserved 1058816K
class space used 1133K, capacity 1210K, committed 1280K, reserved 1048576K
Card table byte_map: [0x00007fd2914e7000,0x00007fd291ee8000] byte_map_base: 0x00007fd28e0e7000
Marking Bits: (ParMarkBitMap*) 0x00007fd294d29f60
Begin Bits: [0x00007fd273000000, 0x00007fd278000000)
End Bits: [0x00007fd278000000, 0x00007fd27d000000)
Polling page: 0x00007fd295979000
CodeCache: size=245760Kb used=1803Kb max_used=1803Kb free=243956Kb
bounds [0x00007fd27d000000, 0x00007fd27d270000, 0x00007fd28c000000]
total_blobs=590 nmethods=255 adapters=257
compilation: enabled
Compilation events (10 events):
Event: 143.796 Thread 0x00007fd28c0da800 252 3 java.lang.ref.Finalizer::hasBeenFinalized (14 bytes)
Event: 143.796 Thread 0x00007fd28c0da800 nmethod 252 0x00007fd27d1c0690 code [0x00007fd27d1c0800, 0x00007fd27d1c09b0]
Event: 143.796 Thread 0x00007fd28c0da800 253 ! 3 java.lang.ref.Finalizer::remove (94 bytes)
Event: 143.797 Thread 0x00007fd28c0da800 nmethod 253 0x00007fd27d1c0a10 code [0x00007fd27d1c0ba0, 0x00007fd27d1c10b0]
Event: 143.797 Thread 0x00007fd28c0da800 254 3 java.lang.System::invokeFinalize (5 bytes)
Event: 143.800 Thread 0x00007fd28c0da800 nmethod 254 0x00007fd27d1c1250 code [0x00007fd27d1c13c0, 0x00007fd27d1c15e8]
Event: 143.800 Thread 0x00007fd28c0da800 240 ! 3 java.lang.ref.Reference::tryHandlePending (115 bytes)
Event: 143.800 Thread 0x00007fd28c0da800 nmethod 240 0x00007fd27d1c1690 code [0x00007fd27d1c18c0, 0x00007fd27d1c25c8]
Event: 143.800 Thread 0x00007fd28c0da800 241 ! 3 java.lang.ref.ReferenceQueue::enqueue (119 bytes)
Event: 143.801 Thread 0x00007fd28c0da800 nmethod 241 0x00007fd27d1c2b10 code [0x00007fd27d1c2cc0, 0x00007fd27d1c34a8]
GC Heap History (2 events):
Event: 143.757 GC heap before
{Heap before GC invocations=1 (full 0):
PSYoungGen total 74752K, used 63191K [0x0000000755580000, 0x000000075a880000, 0x00000007c0000000)
eden space 64512K, 97% used [0x0000000755580000,0x0000000759335f58,0x0000000759480000)
from space 10240K, 0% used [0x0000000759e80000,0x0000000759e80000,0x000000075a880000)
to space 10240K, 0% used [0x0000000759480000,0x0000000759480000,0x0000000759e80000)
ParOldGen total 171008K, used 0K [0x0000000680000000, 0x000000068a700000, 0x0000000755580000)
object space 171008K, 0% used [0x0000000680000000,0x0000000680000000,0x000000068a700000)
Metaspace used 9283K, capacity 9540K, committed 9728K, reserved 1058816K
class space used 1124K, capacity 1210K, committed 1280K, reserved 1048576K
Event: 143.789 GC heap after
Heap after GC invocations=1 (full 0):
PSYoungGen total 74752K, used 10217K [0x0000000755580000, 0x000000075a880000, 0x00000007c0000000)
eden space 64512K, 0% used [0x0000000755580000,0x0000000755580000,0x0000000759480000)
from space 10240K, 99% used [0x0000000759480000,0x0000000759e7a740,0x0000000759e80000)
to space 10240K, 0% used [0x0000000759e80000,0x0000000759e80000,0x000000075a880000)
ParOldGen total 171008K, used 18523K [0x0000000680000000, 0x000000068a700000, 0x0000000755580000)
object space 171008K, 10% used [0x0000000680000000,0x0000000681216e10,0x000000068a700000)
Metaspace used 9283K, capacity 9540K, committed 9728K, reserved 1058816K
class space used 1124K, capacity 1210K, committed 1280K, reserved 1048576K
}
Deoptimization events (2 events):
Event: 0.158 Thread 0x00007fd28c013800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fd27d10af68 method=java.lang.String.hashCode()I @ 14
Event: 0.191 Thread 0x00007fd28c013800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fd27d136898 method=java.lang.String.indexOf(II)I @ 49
Internal exceptions (10 events):
Event: 87.524 Thread 0x00007fd28c013800 Exception <a 'java/lang/ClassNotFoundException': ch/qos/logback/core/encoder/LayoutWrappingEncoderCustomizer> (0x0000000756625c88) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/classfile/systemDictionary.cpp, line 2
Event: 87.531 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 68> (0x00000007566296c0) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.534 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 35> (0x000000075662d420) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.535 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 6> (0x000000075662eed8) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.536 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 36> (0x0000000756631058) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.596 Thread 0x00007fd28c013800 Exception <a 'java/lang/ClassNotFoundException': ch/qos/logback/core/pattern/PatternLayoutEncoderBaseCustomizer> (0x00000007566644e0) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/classfile/systemDictionary.cpp, lin
Event: 87.603 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 78> (0x0000000756667e10) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.605 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 36> (0x000000075666a4b8) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.671 Thread 0x00007fd28c013800 Exception <a 'java/lang/ClassNotFoundException': ch/qos/logback/classic/encoder/PatternLayoutEncoderCustomizer> (0x00000007566a24f8) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/classfile/systemDictionary.cpp, line
Event: 87.678 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 98> (0x00000007566a5890) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Events (10 events):
Event: 148.930 loading class gnu/trove/list/array/TShortArrayList
Event: 148.930 loading class gnu/trove/list/array/TShortArrayList done
Event: 148.932 loading class gnu/trove/list/array/TShortArrayList
Event: 148.932 loading class gnu/trove/list/array/TShortArrayList done
Event: 148.933 loading class gnu/trove/iterator/TShortIterator
Event: 148.933 loading class gnu/trove/iterator/TShortIterator done
Event: 148.934 loading class gnu/trove/procedure/TShortProcedure
Event: 148.934 loading class gnu/trove/procedure/TShortProcedure done
Event: 148.935 loading class gnu/trove/function/TShortFunction
Event: 148.935 loading class gnu/trove/function/TShortFunction done
....
在您的代码或 R5 库中有一个对 org.nustaq.offheap.bytez.malloc.MallocBytez.copyTo
的调用,它在内部调用 sun.misc.Unsafe.copyMemory
您在处理不安全的 api 时需要非常小心。
始终建议不要使用 sun.misc.Unsafe
api's,它仅用于 java 内部 api's。
请找到提出同样问题的博客- https://jaxenter.com/hazelcast-on-java-unsafe-class-119286.html
从崩溃日志中可以清楚地看出,在处理不安全的 api 时存在问题
Stack: [0x00007fd29585b000,0x00007fd29595c000], sp=0x00007fd295959eb8, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x7fe2d4]
j sun.misc.Unsafe.copyMemory(Ljava/lang/Object;JLjava/lang/Object;JJ)V+0
j org.nustaq.offheap.bytez.malloc.MallocBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+38
j com.conveyal.r5.util.ExpandingMMFBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+20
问题主要是由于当前 r5 API 和可用的 network.dat 文件不匹配而导致的,该文件是用某些早期版本的 r5 生成的。要解决此问题,请删除 network.dat 并使用当前版本重新生成。这将解决问题。
R5 在加载前不验证 network.dat,并且 api 在加载时抛出异常。
我正在使用一个名为 R5 的库。它有一个主要方法 com.conveyal.r5.R5Main
将其作为服务启动。它工作得很好。但是当我尝试在我的应用程序中将它用作库并调用相同的流程时,JVM 崩溃并在控制台上打印以下痕迹。
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fd2945622d4, pid=20894, tid=0x00007fd29595b700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x7fe2d4]
#
# 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:
# /home/user/workspace/r5-project/hs_err_pid20894.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
我的项目pom.xml
是:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.playground.r5</groupId>
<artifactId>r5-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>r5-project</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.conveyal</groupId>
<artifactId>r5</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
</project>
崩溃的代码是:
String dir = "/home/user/r5/portland";
File file = new File(dir, "network.dat");
TransportNetwork transportNetwork = TransportNetwork.read(file);
它提到的文件hs_err_pid20894.log
的内容是:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fd2945622d4, pid=20894, tid=0x00007fd29595b700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x7fe2d4]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x00007fd28c013800): JavaThread "main" [_thread_in_vm, id=20901, stack(0x00007fd29585b000,0x00007fd29595c000)]
siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x00007fd22c021000
Registers:
RAX=0x00007fd2840a6264, RBX=0x00007fd28c013800, RCX=0x00000006db82e378, RDX=0xfffffffff4fef5b4
RSP=0x00007fd295959eb8, RBP=0x00007fd295959f10, RSI=0x0000000000000000, RDI=0x00007fd229a8ed0c
R8 =0x000000002d30bab3, R9 =0x0000000000000010, R10=0x00007fd27d01fc78, R11=0x00007fd294729190
R12=0x0000000000000000, R13=0x00007fd295959fe8, R14=0x00007fd294d25f40, R15=0x00007fd294d2acc0
RIP=0x00007fd2945622d4, EFLAGS=0x0000000000010286, CSGSFS=0x0000000000000033, ERR=0x0000000000000004
TRAPNO=0x000000000000000e
Top of Stack: (sp=0x00007fd295959eb8)
0x00007fd295959eb8: 00007fd2947ff2af 0000000000000010
0x00007fd295959ec8: 00007fd229a8ed0c 00007fd28c013800
0x00007fd295959ed8: 00007fd200000000 00007fd295959fa8
0x00007fd295959ee8: 00007fd272880dc8 0000000000000000
0x00007fd295959ef8: 00007fd272880dc8 00007fd29595a008
0x00007fd295959f08: 00007fd28c013800 00007fd295959fa8
0x00007fd295959f18: 00007fd27d01fca4 000000005a617566
0x00007fd295959f28: 00007fd295959f80 00007fd28c013800
0x00007fd295959f38: 00007fd295959f90 00007fd272880dc8
0x00007fd295959f48: 0000000000000000 00007fd295959fa8
0x00007fd295959f58: 00007fd27d01f8bb 00007fd27d01f879
0x00007fd295959f68: 00007fd295959f68 00007fd272880dc8
0x00007fd295959f78: 00007fd29595a008 00007fd2728aed80
0x00007fd295959f88: 0000000000000000 00007fd272880dc8
0x00007fd295959f98: 0000000000000000 00007fd295959fc8
0x00007fd295959fa8: 00007fd29595a050 00007fd27d00833d
0x00007fd295959fb8: 0000000000000000 00007fd27d016478
0x00007fd295959fc8: 000000005a617566 00007fd29595a050
0x00007fd295959fd8: 0000000000000010 00000007559d0c70
0x00007fd295959fe8: 0000000681216e10 00007fd229a8ed0c
0x00007fd295959ff8: 00007fd27d018dd2 0000000000000000
0x00007fd29595a008: 00000007594b3ee0 00007fd29595a010
0x00007fd29595a018: 00007fd272e0c106 00007fd29595a0a8
0x00007fd29595a028: 00007fd272e0db08 0000000000000000
0x00007fd29595a038: 00007fd272e0c198 00007fd295959fc8
0x00007fd29595a048: 00007fd29595a070 00007fd29595a0f0
0x00007fd29595a058: 00007fd27d00833d 0000000000000000
0x00007fd29595a068: 00000007559d0c70 000000005a617566
0x00007fd29595a078: 00007fd200000000 0000000001b8ed0c
0x00007fd29595a088: 0000000000000000 0000000000000000
0x00007fd29595a098: 00007fd27d018dd2 00000007559d0c70
0x00007fd29595a0a8: 0000000759487a20 00007fd29595a0b0
Instructions: (pc=0x00007fd2945622d4)
0x00007fd2945622b4: 74 47 fe 66 89 71 08 c3 0f 1f 40 00 48 8b 74 d0
0x00007fd2945622c4: e8 48 89 74 d1 e8 48 8b 74 d0 f0 48 89 74 d1 f0
0x00007fd2945622d4: 48 8b 74 d0 f8 48 89 74 d1 f8 48 8b 34 d0 48 89
0x00007fd2945622e4: 34 d1 48 83 c2 04 7e d4 48 83 ea 04 7c 93 eb a1
Register to memory mapping:
RAX=0x00007fd2840a6264 is an unknown value
RBX=0x00007fd28c013800 is a thread
RCX=0x00000006db82e378 is pointing into object: 0x0000000681216e10
[B
- klass: {type array byte}
- length: 1516336486
RDX=0xfffffffff4fef5b4 is an unknown value
RSP=0x00007fd295959eb8 is pointing into the stack for thread: 0x00007fd28c013800
RBP=0x00007fd295959f10 is pointing into the stack for thread: 0x00007fd28c013800
RSI=0x0000000000000000 is an unknown value
RDI=0x00007fd229a8ed0c is an unknown value
R8 =0x000000002d30bab3 is an unknown value
R9 =0x0000000000000010 is an unknown value
R10=0x00007fd27d01fc78 is at code_begin+1528 in an Interpreter codelet
method entry point (kind = native) [0x00007fd27d01f680, 0x00007fd27d0205c0] 3904 bytes
R11=0x00007fd294729190: <offset 0x9c5190> in /usr/lib/jvm/java-8-oracle/jre/lib/amd64/server/libjvm.so at 0x00007fd293d64000
R12=0x0000000000000000 is an unknown value
R13=0x00007fd295959fe8 is pointing into the stack for thread: 0x00007fd28c013800
R14=0x00007fd294d25f40: <offset 0xfc1f40> in /usr/lib/jvm/java-8-oracle/jre/lib/amd64/server/libjvm.so at 0x00007fd293d64000
R15=0x00007fd294d2acc0: <offset 0xfc6cc0> in /usr/lib/jvm/java-8-oracle/jre/lib/amd64/server/libjvm.so at 0x00007fd293d64000
Stack: [0x00007fd29585b000,0x00007fd29595c000], sp=0x00007fd295959eb8, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x7fe2d4]
j sun.misc.Unsafe.copyMemory(Ljava/lang/Object;JLjava/lang/Object;JJ)V+0
j org.nustaq.offheap.bytez.malloc.MallocBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+38
j com.conveyal.r5.util.ExpandingMMFBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+20
j org.nustaq.serialization.coders.FSTBytezDecoder.readStringAsc()Ljava/lang/String;+60
j org.nustaq.serialization.FSTClazzNameRegistry.decodeClass(Lorg/nustaq/serialization/FSTDecoder;Lorg/nustaq/serialization/FSTConfiguration;)Lorg/nustaq/serialization/FSTClazzInfo;+28
j org.nustaq.serialization.coders.FSTBytezDecoder.readClass()Lorg/nustaq/serialization/FSTClazzInfo;+9
j org.nustaq.serialization.FSTObjectInput.readClass()Lorg/nustaq/serialization/FSTClazzInfo;+4
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+28
j org.nustaq.serialization.FSTObjectInput.readObjectFields(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Lorg/nustaq/serialization/FSTClazzInfo;[Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Ljava/lang/Object;II)V+491
j org.nustaq.serialization.FSTObjectInput.instantiateAndReadNoSer(Ljava/lang/Class;Lorg/nustaq/serialization/FSTClazzInfo;Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;I)Ljava/lang/Object;+266
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+172
j org.nustaq.serialization.FSTObjectInput.readObjectFields(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Lorg/nustaq/serialization/FSTClazzInfo;[Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Ljava/lang/Object;II)V+491
j org.nustaq.serialization.FSTObjectInput.instantiateAndReadNoSer(Ljava/lang/Class;Lorg/nustaq/serialization/FSTClazzInfo;Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;I)Ljava/lang/Object;+266
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+172
j org.nustaq.serialization.FSTObjectInput.readObjectInternal([Ljava/lang/Class;)Ljava/lang/Object;+38
j org.nustaq.serialization.FSTObjectInput.readObject([Ljava/lang/Class;)Ljava/lang/Object;+63
j com.conveyal.r5.util.ExpandingMMFBytez.readObjectFromFile(Ljava/io/File;)Ljava/lang/Object;+38
j com.conveyal.r5.transit.TransportNetwork.read(Ljava/io/File;)Lcom/conveyal/r5/transit/TransportNetwork;+11
j org.playground.otp.otp.R5App.main([Ljava/lang/String;)V+15
v ~StubRoutines::call_stub
V [libjvm.so+0x691d16]
V [libjvm.so+0x6d3132]
V [libjvm.so+0x6ef99a]
C [libjli.so+0x7bdf] JavaMain+0x81f
C [libpthread.so.0+0x76ba] start_thread+0xca
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j sun.misc.Unsafe.copyMemory(Ljava/lang/Object;JLjava/lang/Object;JJ)V+0
j org.nustaq.offheap.bytez.malloc.MallocBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+38
j com.conveyal.r5.util.ExpandingMMFBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+20
j org.nustaq.serialization.coders.FSTBytezDecoder.readStringAsc()Ljava/lang/String;+60
j org.nustaq.serialization.FSTClazzNameRegistry.decodeClass(Lorg/nustaq/serialization/FSTDecoder;Lorg/nustaq/serialization/FSTConfiguration;)Lorg/nustaq/serialization/FSTClazzInfo;+28
j org.nustaq.serialization.coders.FSTBytezDecoder.readClass()Lorg/nustaq/serialization/FSTClazzInfo;+9
j org.nustaq.serialization.FSTObjectInput.readClass()Lorg/nustaq/serialization/FSTClazzInfo;+4
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+28
j org.nustaq.serialization.FSTObjectInput.readObjectFields(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Lorg/nustaq/serialization/FSTClazzInfo;[Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Ljava/lang/Object;II)V+491
j org.nustaq.serialization.FSTObjectInput.instantiateAndReadNoSer(Ljava/lang/Class;Lorg/nustaq/serialization/FSTClazzInfo;Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;I)Ljava/lang/Object;+266
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+172
j org.nustaq.serialization.FSTObjectInput.readObjectFields(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Lorg/nustaq/serialization/FSTClazzInfo;[Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;Ljava/lang/Object;II)V+491
j org.nustaq.serialization.FSTObjectInput.instantiateAndReadNoSer(Ljava/lang/Class;Lorg/nustaq/serialization/FSTClazzInfo;Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;I)Ljava/lang/Object;+266
j org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(Lorg/nustaq/serialization/FSTClazzInfo$FSTFieldInfo;)Ljava/lang/Object;+172
j org.nustaq.serialization.FSTObjectInput.readObjectInternal([Ljava/lang/Class;)Ljava/lang/Object;+38
j org.nustaq.serialization.FSTObjectInput.readObject([Ljava/lang/Class;)Ljava/lang/Object;+63
j com.conveyal.r5.util.ExpandingMMFBytez.readObjectFromFile(Ljava/io/File;)Ljava/lang/Object;+38
j com.conveyal.r5.transit.TransportNetwork.read(Ljava/io/File;)Lcom/conveyal/r5/transit/TransportNetwork;+11
j org.playground.otp.otp.R5App.main([Ljava/lang/String;)V+15
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x00007fd28c0f8000 JavaThread "Service Thread" daemon [_thread_blocked, id=20924, stack(0x00007fd2708b4000,0x00007fd2709b5000)]
0x00007fd28c0da800 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=20923, stack(0x00007fd2709b5000,0x00007fd270ab6000)]
0x00007fd28c0d8800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=20922, stack(0x00007fd270ab6000,0x00007fd270bb7000)]
0x00007fd28c0d5800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=20921, stack(0x00007fd270bb7000,0x00007fd270cb8000)]
0x00007fd250001000 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=20917, stack(0x00007fd270cb8000,0x00007fd270db9000)]
0x00007fd28c0d3800 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=20916, stack(0x00007fd270db9000,0x00007fd270eba000)]
0x00007fd28c0d0000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=20915, stack(0x00007fd270eba000,0x00007fd270fbb000)]
0x00007fd28c0bf800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=20911, stack(0x00007fd2711bf000,0x00007fd2712c0000)]
0x00007fd28c08d800 JavaThread "Finalizer" daemon [_thread_blocked, id=20908, stack(0x00007fd2712c0000,0x00007fd2713c1000)]
0x00007fd28c089000 JavaThread "Reference Handler" daemon [_thread_blocked, id=20907, stack(0x00007fd2713c1000,0x00007fd2714c2000)]
=>0x00007fd28c013800 JavaThread "main" [_thread_in_vm, id=20901, stack(0x00007fd29585b000,0x00007fd29595c000)]
Other Threads:
0x00007fd28c081800 VMThread [stack: 0x00007fd2714c2000,0x00007fd2715c3000] [id=20906]
0x00007fd28c10b000 WatcherThread [stack: 0x00007fd2707b3000,0x00007fd2708b4000] [id=20925]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap:
PSYoungGen total 74752K, used 27738K [0x0000000755580000, 0x000000075a880000, 0x00000007c0000000)
eden space 64512K, 27% used [0x0000000755580000,0x000000075669c2f0,0x0000000759480000)
from space 10240K, 99% used [0x0000000759480000,0x0000000759e7a740,0x0000000759e80000)
to space 10240K, 0% used [0x0000000759e80000,0x0000000759e80000,0x000000075a880000)
ParOldGen total 1652224K, used 1499320K [0x0000000680000000, 0x00000006e4d80000, 0x0000000755580000)
object space 1652224K, 90% used [0x0000000680000000,0x00000006db82e388,0x00000006e4d80000)
Metaspace used 9358K, capacity 9604K, committed 9728K, reserved 1058816K
class space used 1133K, capacity 1210K, committed 1280K, reserved 1048576K
Card table byte_map: [0x00007fd2914e7000,0x00007fd291ee8000] byte_map_base: 0x00007fd28e0e7000
Marking Bits: (ParMarkBitMap*) 0x00007fd294d29f60
Begin Bits: [0x00007fd273000000, 0x00007fd278000000)
End Bits: [0x00007fd278000000, 0x00007fd27d000000)
Polling page: 0x00007fd295979000
CodeCache: size=245760Kb used=1803Kb max_used=1803Kb free=243956Kb
bounds [0x00007fd27d000000, 0x00007fd27d270000, 0x00007fd28c000000]
total_blobs=590 nmethods=255 adapters=257
compilation: enabled
Compilation events (10 events):
Event: 143.796 Thread 0x00007fd28c0da800 252 3 java.lang.ref.Finalizer::hasBeenFinalized (14 bytes)
Event: 143.796 Thread 0x00007fd28c0da800 nmethod 252 0x00007fd27d1c0690 code [0x00007fd27d1c0800, 0x00007fd27d1c09b0]
Event: 143.796 Thread 0x00007fd28c0da800 253 ! 3 java.lang.ref.Finalizer::remove (94 bytes)
Event: 143.797 Thread 0x00007fd28c0da800 nmethod 253 0x00007fd27d1c0a10 code [0x00007fd27d1c0ba0, 0x00007fd27d1c10b0]
Event: 143.797 Thread 0x00007fd28c0da800 254 3 java.lang.System::invokeFinalize (5 bytes)
Event: 143.800 Thread 0x00007fd28c0da800 nmethod 254 0x00007fd27d1c1250 code [0x00007fd27d1c13c0, 0x00007fd27d1c15e8]
Event: 143.800 Thread 0x00007fd28c0da800 240 ! 3 java.lang.ref.Reference::tryHandlePending (115 bytes)
Event: 143.800 Thread 0x00007fd28c0da800 nmethod 240 0x00007fd27d1c1690 code [0x00007fd27d1c18c0, 0x00007fd27d1c25c8]
Event: 143.800 Thread 0x00007fd28c0da800 241 ! 3 java.lang.ref.ReferenceQueue::enqueue (119 bytes)
Event: 143.801 Thread 0x00007fd28c0da800 nmethod 241 0x00007fd27d1c2b10 code [0x00007fd27d1c2cc0, 0x00007fd27d1c34a8]
GC Heap History (2 events):
Event: 143.757 GC heap before
{Heap before GC invocations=1 (full 0):
PSYoungGen total 74752K, used 63191K [0x0000000755580000, 0x000000075a880000, 0x00000007c0000000)
eden space 64512K, 97% used [0x0000000755580000,0x0000000759335f58,0x0000000759480000)
from space 10240K, 0% used [0x0000000759e80000,0x0000000759e80000,0x000000075a880000)
to space 10240K, 0% used [0x0000000759480000,0x0000000759480000,0x0000000759e80000)
ParOldGen total 171008K, used 0K [0x0000000680000000, 0x000000068a700000, 0x0000000755580000)
object space 171008K, 0% used [0x0000000680000000,0x0000000680000000,0x000000068a700000)
Metaspace used 9283K, capacity 9540K, committed 9728K, reserved 1058816K
class space used 1124K, capacity 1210K, committed 1280K, reserved 1048576K
Event: 143.789 GC heap after
Heap after GC invocations=1 (full 0):
PSYoungGen total 74752K, used 10217K [0x0000000755580000, 0x000000075a880000, 0x00000007c0000000)
eden space 64512K, 0% used [0x0000000755580000,0x0000000755580000,0x0000000759480000)
from space 10240K, 99% used [0x0000000759480000,0x0000000759e7a740,0x0000000759e80000)
to space 10240K, 0% used [0x0000000759e80000,0x0000000759e80000,0x000000075a880000)
ParOldGen total 171008K, used 18523K [0x0000000680000000, 0x000000068a700000, 0x0000000755580000)
object space 171008K, 10% used [0x0000000680000000,0x0000000681216e10,0x000000068a700000)
Metaspace used 9283K, capacity 9540K, committed 9728K, reserved 1058816K
class space used 1124K, capacity 1210K, committed 1280K, reserved 1048576K
}
Deoptimization events (2 events):
Event: 0.158 Thread 0x00007fd28c013800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fd27d10af68 method=java.lang.String.hashCode()I @ 14
Event: 0.191 Thread 0x00007fd28c013800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007fd27d136898 method=java.lang.String.indexOf(II)I @ 49
Internal exceptions (10 events):
Event: 87.524 Thread 0x00007fd28c013800 Exception <a 'java/lang/ClassNotFoundException': ch/qos/logback/core/encoder/LayoutWrappingEncoderCustomizer> (0x0000000756625c88) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/classfile/systemDictionary.cpp, line 2
Event: 87.531 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 68> (0x00000007566296c0) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.534 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 35> (0x000000075662d420) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.535 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 6> (0x000000075662eed8) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.536 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 36> (0x0000000756631058) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.596 Thread 0x00007fd28c013800 Exception <a 'java/lang/ClassNotFoundException': ch/qos/logback/core/pattern/PatternLayoutEncoderBaseCustomizer> (0x00000007566644e0) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/classfile/systemDictionary.cpp, lin
Event: 87.603 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 78> (0x0000000756667e10) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.605 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 36> (0x000000075666a4b8) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Event: 87.671 Thread 0x00007fd28c013800 Exception <a 'java/lang/ClassNotFoundException': ch/qos/logback/classic/encoder/PatternLayoutEncoderCustomizer> (0x00000007566a24f8) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/classfile/systemDictionary.cpp, line
Event: 87.678 Thread 0x00007fd28c013800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 98> (0x00000007566a5890) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8u131/8869/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp, line 366]
Events (10 events):
Event: 148.930 loading class gnu/trove/list/array/TShortArrayList
Event: 148.930 loading class gnu/trove/list/array/TShortArrayList done
Event: 148.932 loading class gnu/trove/list/array/TShortArrayList
Event: 148.932 loading class gnu/trove/list/array/TShortArrayList done
Event: 148.933 loading class gnu/trove/iterator/TShortIterator
Event: 148.933 loading class gnu/trove/iterator/TShortIterator done
Event: 148.934 loading class gnu/trove/procedure/TShortProcedure
Event: 148.934 loading class gnu/trove/procedure/TShortProcedure done
Event: 148.935 loading class gnu/trove/function/TShortFunction
Event: 148.935 loading class gnu/trove/function/TShortFunction done
....
在您的代码或 R5 库中有一个对 org.nustaq.offheap.bytez.malloc.MallocBytez.copyTo
的调用,它在内部调用 sun.misc.Unsafe.copyMemory
您在处理不安全的 api 时需要非常小心。
始终建议不要使用 sun.misc.Unsafe
api's,它仅用于 java 内部 api's。
请找到提出同样问题的博客- https://jaxenter.com/hazelcast-on-java-unsafe-class-119286.html
从崩溃日志中可以清楚地看出,在处理不安全的 api 时存在问题
Stack: [0x00007fd29585b000,0x00007fd29595c000], sp=0x00007fd295959eb8, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x7fe2d4]
j sun.misc.Unsafe.copyMemory(Ljava/lang/Object;JLjava/lang/Object;JJ)V+0
j org.nustaq.offheap.bytez.malloc.MallocBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+38
j com.conveyal.r5.util.ExpandingMMFBytez.copyTo(Lorg/nustaq/offheap/bytez/BasicBytez;JJJ)V+20
问题主要是由于当前 r5 API 和可用的 network.dat 文件不匹配而导致的,该文件是用某些早期版本的 r5 生成的。要解决此问题,请删除 network.dat 并使用当前版本重新生成。这将解决问题。
R5 在加载前不验证 network.dat,并且 api 在加载时抛出异常。