truffleruby
truffleruby copied to clipboard
Segfault on bundle install
truffleruby 22.1.0, like ruby 3.0.2, GraalVM CE Native [x86_64-linux]
Hit this randomly this morning doing a bundle install for a project called memfs (https://github.com/simonc/memfs). I was unable to replicate though. There's nothing special about the Gemfile (except maybe the frozen string literal pragma?), so the fact that it happened during a bundle install might just be a coincidence.
I had to snip the backtrace for github, the full backtrace is at https://gist.github.com/djberg96/86934a56a07a35a773d33797bc2dd232
[ [ SubstrateSegfaultHandler caught a segfault in thread 0x000000000198fe40 ] ]
siginfo: si_signo: 11, si_code: 1, si_addr: 0x00007fac57f50000
Current timestamp: 1651666396281
General purpose register values:
RAX 0x00007fac57f50000 is an unknown value
RBX 0x00007fac23e011c0 points into the old generation
is an object of type org.truffleruby.language.control.FrameOnStackMarker
RCX 0x00007fac57f50000 is an unknown value
RDX 0x00007fac23e01160 points into the old generation
is an object of type com.oracle.truffle.api.impl.FrameWithoutBoxing
RBP 0x00007fac23e01028 points into the old generation
is an object of type [J
RSI 0x00007fac23e01260 points into the old generation
is an object of type [Ljava.lang.Object;
RDI 0x00007fac23e012b0 points into the old generation
is an object of type com.oracle.svm.truffle.api.SubstrateOptimizedCallTarget
RSP 0x00007ffd18dd2868 points into the stack for thread 0x000000000198fe40
R8 0x00007fac23e01028 points into the old generation
is an object of type [J
R9 0x00007fac23e01260 points into the old generation
is an object of type [Ljava.lang.Object;
R10 0xffffffffd31011c0 is an unknown value
R11 0x00007fac23e01028 points into the old generation
is an object of type [J
R12 0x00007fac23e01028 points into the old generation
is an object of type [J
R13 0x00007fac23e01028 points into the old generation
is an object of type [J
R14 0x00007fac50d00000 is the heap base
R15 0x000000000198fe40 is a thread
EFL 0x0000000000010206 is an unknown value
RIP 0x00007fac57f50000 is an unknown value
Printing Instructions (ip=0x00007fac57f50000):
0x00007fac57f4ffe0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00007fac57f4fff0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00007fac57f50000:
[ [ SubstrateSegfaultHandler caught a segfault in thread 0x000000000198fe40 ] ]
siginfo: si_signo: 11, si_code: 1, si_addr: 0x00007fac57f50000
Printing Instructions (ip=0x00007fac57f50000):
0x00007fac57f4fff0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00007fac57f50000:
[ [ SubstrateSegfaultHandler caught a segfault in thread 0x000000000198fe40 ] ]
siginfo: si_signo: 11, si_code: 1, si_addr: 0x00007fac57f50000
Printing Instructions (ip=0x00007fac57f50000):
0x00007fac57f50000:
[ [ SubstrateSegfaultHandler caught a segfault in thread 0x000000000198fe40 ] ]
siginfo: si_signo: 11, si_code: 1, si_addr: 0x00007fac57f50000
Top of stack (sp=0x00007ffd18dd2868):
0x00007ffd18dd2868: 0x00007fac50c0d9fe 0x00007fac53b572c0
0x00007ffd18dd2878: 0x00007fac539ef870 0x00007fac50d00000
0x00007ffd18dd2888: 0xffffffffc45ff618 0x00007fac152ff618
0x00007ffd18dd2898: 0x00007fac20417c10 0x0000000002c325a0
0x00007ffd18dd28a8: 0x00007fac555bed90 0x0000000004359270
0x00007ffd18dd28b8: 0x00007fac23e01028 0x00007fac23e01078
0x00007ffd18dd28c8: 0x00007fac23e010a0 0x00007fac23e01110
0x00007ffd18dd28d8: 0x00007fac5a5cc494 0xffffffffce9d9870
0x00007ffd18dd28e8: 0xffffffffce9d98f8 0xffffffffce9d9940
0x00007ffd18dd28f8: 0x0000000004b5d250 0x0000000004359270
0x00007ffd18dd2908: 0x00007fac5585b9c0 0x00007fac52c648f0
0x00007ffd18dd2918: 0x0000000002e8c150 0x00007fac23e01160
0x00007ffd18dd2928: 0x00007fac23e011c0 0x00007fac23e011d8
0x00007ffd18dd2938: 0x00007fac23e01260 0x00007fac5585b9c0
0x00007ffd18dd2948: 0x0000000002c05ee8 0x0000000050d00000
0x00007ffd18dd2958: 0x0000000000000000 0x00007fac54f12518
0x00007ffd18dd2968: 0x00007fac57f50000 0x00007fac23e012b0
0x00007ffd18dd2978: 0x0000000000000000 0x0000000000000000
0x00007ffd18dd2988: 0x00007fac23e01368 0x00007fac555bed90
0x00007ffd18dd2998: 0x00007fac502d2569 0x00007fac29b27750
0x00007ffd18dd29a8: 0x00007fac29b27750 0x00007fac53828f20
0x00007ffd18dd29b8: 0x00007fac587b613b 0x00007fac52a2f050
0x00007ffd18dd29c8: 0x00007fac58787fe2 0x0000000300000004
0x00007ffd18dd29d8: 0x00007fac5a5cb706 0x00007fac03601028
0x00007ffd18dd29e8: 0x00007fac55857af0 0x00007fac5585b9c0
0x00007ffd18dd29f8: 0x00007fac57f5729e 0x00007fac1c8779b8
0x00007ffd18dd2a08: 0x00007fac5a5cc494 0x0000000002c05ee8
0x00007ffd18dd2a18: 0x0000000000000000 0x00007fac1c8779b8
0x00007ffd18dd2a28: 0x00007fac5a8f2d13 0x0000000000000000
0x00007ffd18dd2a38: 0x00007fac58782a4f 0x00007fac54a28518
0x00007ffd18dd2a48: 0x00007fac152ffa40 0x00007fac1304aac8
0x00007ffd18dd2a58: 0x00007fac52a45da0 0x00007fac5585b9c0
DeoptStubPointer address: 0x00007fac5876a110
Top frame info:
Does not look like a Java Frame. Use JavaFrameAnchors to find LastJavaSP:
Threads:
0x00007fac04000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Ruby Thread id=83 from Ruby-reference-processor" - 0x00007fac23e0dc20, stack(0x00007fac09a01000,0x00007fac0a200000)
0x00007fac24000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "TruffleCompilerThread-82" - 0x00007fac23e0e240, daemon, stack(0x00007fac2bf01000,0x00007fac2c700000)
0x00007fac38000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "TruffleCompilerThread-80" - 0x00007fac23e0e548, daemon, stack(0x00007fac48701000,0x00007fac48f00000)
0x00007fac34000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "TruffleCompilerThread-79" - 0x00007fac23e0e7d8, daemon, stack(0x00007fac49101000,0x00007fac49900000)
0x00007fac40000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Ruby-NativeCallInterrupt-Timer" - 0x00007fac23e0e930, daemon, stack(0x00007fac49c8f000,0x00007fac4a48e000)
0x00007fac3c000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "nfi-gc" - 0x00007fac23e0eab8, daemon, stack(0x00007fac4ae01000,0x00007fac4b600000)
0x00007fac44000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Signal Dispatcher" - 0x00007fac23e0ebe0, daemon, stack(0x00007fac4b801000,0x00007fac4c000000)
0x00007fac4c000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x00007fac53833400, daemon, stack(0x00007fac50301000,0x00007fac50b00000)
0x000000000198fe40 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "main" - 0x00007fac53833340, stack(0x00007ffd185e3000,0x00007ffd18de2000)
VM thread locals for the failing thread 0x000000000198fe40:
0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes)
0x000000000198fe40: 0x00007fac52726010
8 (8 bytes): SubstrateFastThreadLocal.CONTEXT = (Object) [Ljava.lang.Object; (0x00007fac23e0ee48)
16 (8 bytes): SubstrateThreadLocalHandshake.STATE = (Object) com.oracle.truffle.api.impl.ThreadLocalHandshake$TruffleSafepointImpl (0x00007fac23e0eed8)
24 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
32 (4 bytes): Safepoint.safepointRequested = (int) 2126839081 (0x7ec4fd29)
36 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
40 (4 bytes): SubstrateThreadLocalHandshake.PENDING = (int) 0 (0x00000000)
48 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes)
0x000000000198fe70: 0x00007fabf9200000 0x00007fabf9300000
0x000000000198fe80: 0x00007fabf9201040 0x0000000000000000
80 (8 bytes): PlatformThreads.currentThread = (Object) java.lang.Thread (0x00007fac53833340)
88 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 0 (0x0000000000000000)
96 (8 bytes): AccessControlContextStack = (Object) java.util.ArrayDeque (0x00007fac23e0ef18)
104 (8 bytes): ExceptionUnwind.currentException = (Object) null
112 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) java.util.SplittableRandom (0x00007fac23e0ef40)
120 (8 bytes): IsolatedCompileClient.currentClient = (Object) null
128 (8 bytes): IsolatedCompileContext.currentContext = (Object) null
136 (8 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x00007fac23e0ef70)
144 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
152 (8 bytes): JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
160 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
168 (8 bytes): JfrThreadLocal.javaEventWriter = (Object) null
176 (8 bytes): NativeClosure.pendingException = (Object) null
184 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
192 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) null
200 (8 bytes): TruffleNFISupport.currentScope = (Object) null
208 (8 bytes): ErrnoMirror.errnoMirror = (bytes)
0x000000000198ff10: 0x0000000000000000
216 (8 bytes): JfrThreadLocal.dataLost = (Word) 0 (0x0000000000000000)
224 (8 bytes): JfrThreadLocal.javaBuffer = (Word) 0 (0x0000000000000000)
232 (8 bytes): JfrThreadLocal.nativeBuffer = (Word) 0 (0x0000000000000000)
240 (8 bytes): JfrThreadLocal.parentThreadId = (long) 0 (0x0000000000000000)
248 (8 bytes): JfrThreadLocal.threadId = (long) 1 (0x0000000000000001)
256 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes)
0x000000000198ff40: 0x0000000000000000
264 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 1502834592 (0x0000000059936fa0)
272 (8 bytes): VMThreads.IsolateTL = (Word) 140378066911232 (0x00007fac50d00000)
280 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 140378386147136 (0x00007fac63d72740)
288 (8 bytes): VMThreads.OSThreadIdTL = (Word) 140378386147136 (0x00007fac63d72740)
296 (8 bytes): VMThreads.StackBase = (Word) 140725020663808 (0x00007ffd18de2000)
304 (8 bytes): VMThreads.StackEnd = (Word) 140725012279296 (0x00007ffd185e3000)
312 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes)
0x000000000198ff78: 0x0000000000000000
320 (8 bytes): VMThreads.nextTL = (Word) 0 (0x0000000000000000)
328 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 26803776 (0x000000000198fe40)
336 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
340 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
344 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
348 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
352 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
356 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 0 (0x00000000)
No VMOperation in progress
The 15 most recent VM operation status changes (oldest first):
1651666396112 - Finished Garbage collection (safepoint: true, queueingThread: 0x000000000198fe40, executingThread: 0x000000000198fe40, safepointId: 358)
1651666396114 - Started Install code (safepoint: true, queueingThread: 0x00007fac34000b80, executingThread: 0x00007fac34000b80, safepointId: 359)
1651666396114 - Finished Install code (safepoint: true, queueingThread: 0x00007fac34000b80, executingThread: 0x00007fac34000b80, safepointId: 359)
1651666396114 - Started Install code (safepoint: true, queueingThread: 0x00007fac38000b80, executingThread: 0x00007fac38000b80, safepointId: 360)
1651666396114 - Finished Install code (safepoint: true, queueingThread: 0x00007fac38000b80, executingThread: 0x00007fac38000b80, safepointId: 360)
1651666396119 - Started Install code (safepoint: true, queueingThread: 0x00007fac24000b80, executingThread: 0x00007fac24000b80, safepointId: 361)
1651666396119 - Finished Install code (safepoint: true, queueingThread: 0x00007fac24000b80, executingThread: 0x00007fac24000b80, safepointId: 361)
1651666396120 - Started Install code (safepoint: true, queueingThread: 0x00007fac24000b80, executingThread: 0x00007fac24000b80, safepointId: 362)
1651666396120 - Finished Install code (safepoint: true, queueingThread: 0x00007fac24000b80, executingThread: 0x00007fac24000b80, safepointId: 362)
1651666396121 - Started Garbage collection (safepoint: true, queueingThread: 0x000000000198fe40, executingThread: 0x000000000198fe40, safepointId: 363)
1651666396131 - Finished Garbage collection (safepoint: true, queueingThread: 0x000000000198fe40, executingThread: 0x000000000198fe40, safepointId: 363)
1651666396134 - Started Install code (safepoint: true, queueingThread: 0x00007fac24000b80, executingThread: 0x00007fac24000b80, safepointId: 364)
1651666396134 - Finished Install code (safepoint: true, queueingThread: 0x00007fac24000b80, executingThread: 0x00007fac24000b80, safepointId: 364)
1651666396141 - Started Garbage collection (safepoint: true, queueingThread: 0x000000000198fe40, executingThread: 0x000000000198fe40, safepointId: 365)
1651666396281 - Finished Garbage collection (safepoint: true, queueingThread: 0x000000000198fe40, executingThread: 0x000000000198fe40, safepointId: 365)
The 20 most recent RuntimeCodeInfo operations (oldest first):
1651666396277 - Freed CodeInfo (0x00007fac34005de0 - 0x00007fac34005e88), unreachable, ip: (0x00007fac642e1000 - 0x00007fac642e202d), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Invalidated CodeInfo (0x00007fac2401b7e0 - 0x00007fac2401b888), partially freed - Integer#times (SubstrateCompilation-6045), ip: (0x00007fac57f50000 - 0x00007fac57f53752), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac2401b7e0 - 0x00007fac2401b888), partially freed, ip: (0x00007fac57f50000 - 0x00007fac57f53752), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac34023560 - 0x00007fac34023608), unreachable, ip: (0x00007fac57feb000 - 0x00007fac57feedd9), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac24017a60 - 0x00007fac24017b08), unreachable, ip: (0x00007fac57fb6000 - 0x00007fac57fb620f), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac24054560 - 0x00007fac24054608), unreachable, ip: (0x00007fac50c09000 - 0x00007fac50c0e2b0), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac38021c80 - 0x00007fac38021d28), unreachable, ip: (0x00007fac58000000 - 0x00007fac58001dcf), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac3402c000 - 0x00007fac3402c0a8), unreachable, ip: (0x00007fac57f49000 - 0x00007fac57f4e2b0), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac24052d00 - 0x00007fac24052da8), unreachable, ip: (0x00007fac57f30000 - 0x00007fac57f34de0), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac24074e80 - 0x00007fac24074f28), unreachable, ip: (0x00007fac50c66000 - 0x00007fac50c68487), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac2402aa10 - 0x00007fac2402aab8), unreachable, ip: (0x00007fac57ff0000 - 0x00007fac57ff16c1), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac2402c090 - 0x00007fac2402c138), unreachable, ip: (0x00007fac57f63000 - 0x00007fac57f6b9ec), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac2400cf10 - 0x00007fac2400cfb8), unreachable, ip: (0x00007fac57fe6000 - 0x00007fac57fe7d3d), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac34014b90 - 0x00007fac34014c38), unreachable, ip: (0x00007fac57f9e000 - 0x00007fac57f9ed98), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac2400c5a0 - 0x00007fac2400c648), unreachable, ip: (0x00007fac57fb7000 - 0x00007fac57fb76e1), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac38030820 - 0x00007fac380308c8), unreachable, ip: (0x00007fac57f6d000 - 0x00007fac57f6e6b3), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac340063a0 - 0x00007fac34006448), unreachable, ip: (0x00007fac57f89000 - 0x00007fac57f8e2b0), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac34059720 - 0x00007fac340597c8), unreachable, ip: (0x00007fac642e1000 - 0x00007fac642e2095), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac240547a0 - 0x00007fac24054848), unreachable, ip: (0x00007fac57fec000 - 0x00007fac57fec3ae), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
1651666396277 - Freed CodeInfo (0x00007fac340b17a0 - 0x00007fac340b1848), unreachable, ip: (0x00007fac50c43000 - 0x00007fac50c43f87), installedCode: (address: 0x0000000000000000, entryPoint: 0x0000000000000000), safepointId: 365
RuntimeCodeInfoMemory contains 122 methods:
CodeInfo (0x00007fac34002230 - 0x00007fac340022d8), code constants live - Truffle::FeatureLoader.find_file (SubstrateCompilation-5927), ip: (0x00007fac642eb000 - 0x00007fac642ebf04), installedCode: (address: 0x00007fac642eb000, entryPoint: 0x00007fac642eb000)
CodeInfo (0x00007fac24019bb0 - 0x00007fac24019c58), code constants live - strlen (SubstrateCompilation-6000), ip: (0x00007fac57f97000 - 0x00007fac57f972f6), installedCode: (address: 0x00007fac57f97000, entryPoint: 0x00007fac57f97000)
CodeInfo (0x00007fac340068b0 - 0x00007fac34006958), code constants live - Array#isort! (SubstrateCompilation-6007), ip: (0x00007fac57f83000 - 0x00007fac57f85733), installedCode: (address: 0x00007fac57f83000, entryPoint: 0x00007fac57f83000)
CodeInfo (0x00007fac2401a6b0 - 0x00007fac2401a758), code constants live - BasicObject#!= (SubstrateCompilation-6034), ip: (0x00007fac57fe4000 - 0x00007fac57fe4ba1), installedCode: (address: 0x00007fac57fe4000, entryPoint: 0x00007fac57fe4000)
CodeInfo (0x00007fac38034130 - 0x00007fac380341d8), code constants live - FFI::Pointer#get_string (SubstrateCompilation-6074), ip: (0x00007fac57f23000 - 0x00007fac57f24c86), installedCode: (address: 0x00007fac57f23000, entryPoint: 0x00007fac57f23000)
CodeInfo (0x00007fac3802f1b0 - 0x00007fac3802f258), code constants live - __sulong_byte_array_to_native
[snipped because it was too long]
Segfault detected, aborting process. Use runtime option -R:-InstallSegfaultHandler if you don't want to use SubstrateSegfaultHandler.
Thanks for the report, I've filed an internal issue (GR-38555) for the native image team. It seems similar to #2646.