Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault in graal native-image code using quarkus. #864

Open
shepherd85 opened this issue Dec 20, 2024 · 0 comments
Open

Segfault in graal native-image code using quarkus. #864

shepherd85 opened this issue Dec 20, 2024 · 0 comments

Comments

@shepherd85
Copy link

I'm trying to use msgpack in a Quarkus native project, but it is giving warnings during build:

Warning: RecomputeFieldValue.ArrayBaseOffset automatic substitution failed. The automatic substitution registration was attempted because a call to jdk.internal.misc.Unsafe.arrayBaseOffset(Class) was detected in the static initializer of org.msgpack.core.buffer.MessageBuffer. Detailed failure reason(s): Could not determine the field where the value produced by the call to jdk.internal.misc.Unsafe.arrayBaseOffset(Class) for the array base offset computation is stored. The call is not directly followed by a field store or by a sign extend node followed directly by a field store.
Warning: RecomputeFieldValue.ArrayIndexScale automatic substitution failed. The automatic substitution registration was attempted because a call to jdk.internal.misc.Unsafe.arrayIndexScale(Class) was detected in the static initializer of org.msgpack.core.buffer.MessageBuffer. Detailed failure reason(s): Could not determine the field where the value produced by the call to jdk.internal.misc.Unsafe.arrayIndexScale(Class) for the array index scale computation is stored. The call is not directly followed by a field store or by a sign extend node followed directly by a field store.

And results in a segfault during execution:

[ [ SegfaultHandler caught a segfault in thread 0x000001ec9c943dc0 ] ]
siginfo: ExceptionCode: -1073741819, reading address 0x000001ec9e600118 (heapBase + 280)
General purpose register values:
  RAX 0x00000000060d295c is an unknown value
  RBX 0x00000000060dfb7a is an unknown value
  RCX 0x0000000000001ffe is an unknown value
  RDX 0x000001eccecffc08 points into an aligned TLAB chunk of thread 0x000001ec9c943dc0
    is an object of type org.msgpack.core.MessagePacker
  RBP 0x0000000000000000
  RSI 0x0000000000000000
  RDI 0x000001eccecfdbd0 points into an aligned TLAB chunk of thread 0x000001ec9c943dc0
    is an object of type [B with length 8192: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ...
  RSP 0x000000dee597eb30 points into the stack for thread 0x000001ec9c943dc0
  R8  0x000001eccec94ae0 points into an aligned TLAB chunk of thread 0x000001ec9c943dc0
  R9  0x0000000000000000
  R10 0x000001eccecffbe8 points into an aligned TLAB chunk of thread 0x000001ec9c943dc0
    is an object of type org.msgpack.core.buffer.MessageBuffer
  R11 0x0000000000000000
  R12 0x000000000000059e is an unknown value
  R13 0x00000000000005a5 is an unknown value
  R14 0x000001ec9e600000 is the heap base
  R15 0x000001ec9c943dc0 is a thread
  EFL 0x0000000000010297 is an unknown value
  RIP 0x00007ff6fb094c1d points into AOT compiled code org.msgpack.core.MessagePacker.flushBuffer(MessagePacker.java)

Printing instructions (ip=0x00007ff6fb094c1d):
  0x00007ff6fb094b1d: 0x51 0xfc 0x48 0x8b 0xe3 0x83 0x7a 0x20 0x01 0x0f 0x8d 0x5b 0x00 0x00 0x00 0x8b
  0x00007ff6fb094b2d: 0x52 0x04 0x90 0x85 0xd2 0x0f 0x84 0x65 0x00 0x00 0x00 0x41 0x8b 0x54 0xd6 0x04
  0x00007ff6fb094b3d: 0x85 0xd2 0x0f 0x84 0x5e 0x00 0x00 0x00 0x41 0x8b 0x04 0xd6 0xc1 0xe8 0x05 0x0f
  0x00007ff6fb094b4d: 0x1f 0x40 0x00 0x81 0xf8 0x7c 0x30 0xa8 0x02 0x0f 0x84 0x1b 0x00 0x00 0x00 0x81
  0x00007ff6fb094b5d: 0xf8 0x0a 0x2f 0xa8 0x02 0x0f 0x84 0x0f 0x00 0x00 0x00 0x49 0x8b 0x84 0xc6 0xa8
  0x00007ff6fb094b6d: 0x00 0x00 0x00 0x49 0x8d 0x14 0xd6 0xff 0xd0 0x90 0x48 0x83 0xc4 0x18 0x41 0x83
  0x00007ff6fb094b7d: 0x6f 0x10 0x01 0x0f 0x8e 0xea 0x87 0x64 0xfc 0xc3 0x48 0x8b 0xc2 0x48 0x89 0x44
  0x00007ff6fb094b8d: 0x24 0x10 0x90 0xe8 0x1b 0x00 0x00 0x00 0x90 0x48 0x8b 0x54 0x24 0x10 0xeb 0x8f
  0x00007ff6fb094b9d: 0xe8 0x6e 0x46 0x63 0xfc 0x90 0xe8 0x68 0x46 0x63 0xfc 0x90 0xcc 0xcc 0xcc 0xcc
  0x00007ff6fb094bad: 0xcc 0xcc 0xcc 0x48 0x8d 0x5c 0x24 0xc8 0x49 0x3b 0x5f 0x08 0x0f 0x86 0x21 0x87
  0x00007ff6fb094bbd: 0x51 0xfc 0x48 0x8b 0xe3 0x8b 0x42 0x04 0x85 0xc0 0x0f 0x84 0x5f 0x01 0x00 0x00
  0x00007ff6fb094bcd: 0x45 0x8b 0x44 0xc6 0x08 0x8b 0x4a 0x20 0x45 0x85 0xc0 0x0f 0x84 0x58 0x01 0x00
  0x00007ff6fb094bdd: 0x00 0x41 0x8b 0x44 0xc6 0x04 0x85 0xc0 0x0f 0x84 0x55 0x01 0x00 0x00 0x48 0x89
  0x00007ff6fb094bed: 0x54 0x24 0x20 0x45 0x8b 0x0c 0xc6 0x43 0x8b 0x5c 0xc6 0x04 0x47 0x8b 0x44 0xc6
  0x00007ff6fb094bfd: 0x10 0x41 0x8d 0x70 0xf0 0x49 0x8d 0x3c 0xde 0x41 0xc1 0xe9 0x05 0x4d 0x8d 0x04
  0x00007ff6fb094c0d: 0xc6 0x66 0x90 0x41 0x81 0xf9 0x7c 0x30 0xa8 0x02 0x0f 0x84 0x48 0x00 0x00 0x00
> 0x00007ff6fb094c1d: 0x4b 0x8b 0x84 0xce 0x18 0x01 0x00 0x00 0x49 0x8b 0xd0 0x4c 0x8b 0xc7 0x44 0x8b
  0x00007ff6fb094c2d: 0xce 0x8b 0xf9 0xff 0xd0 0x90 0x48 0x8b 0x54 0x24 0x20 0xc7 0x42 0x08 0x00 0x00
  0x00007ff6fb094c3d: 0x00 0x00 0x48 0x8b 0x42 0x10 0x48 0x63 0x4a 0x20 0x48 0x03 0xc8 0x48 0x89 0x4a
  0x00007ff6fb094c4d: 0x10 0xc7 0x42 0x20 0x00 0x00 0x00 0x00 0x48 0x83 0xc4 0x38 0x41 0x83 0x6f 0x10
  0x00007ff6fb094c5d: 0x01 0x0f 0x8e 0x0c 0x87 0x64 0xfc 0xc3 0x89 0x44 0x24 0x1c 0x89 0x5c 0x24 0x18
  0x00007ff6fb094c6d: 0x48 0x89 0x7c 0x24 0x10 0x4c 0x89 0x44 0x24 0x08 0x8b 0xd9 0x8b 0xce 0xe9 0x67
  0x00007ff6fb094c7d: 0x00 0x00 0x00 0x66 0x66 0x66 0x0f 0x1f 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66
  0x00007ff6fb094c8d: 0x66 0x90 0x90 0x47 0x8b 0x54 0xce 0x04 0x45 0x8b 0x5c 0xc6 0x14 0x45 0x8b 0xe2
  0x00007ff6fb094c9d: 0x45 0x2b 0xe3 0x44 0x3b 0xe3 0x44 0x0f 0x4f 0xe3 0x66 0x0f 0x1f 0x84 0x00 0x00
  0x00007ff6fb094cad: 0x00 0x00 0x00 0x41 0x83 0xfc 0x01 0x0f 0x8d 0x97 0x00 0x00 0x00 0x89 0x4c 0x24
  0x00007ff6fb094cbd: 0x34 0x83 0xfb 0x01 0x0f 0x8c 0x33 0x00 0x00 0x00 0x89 0x5c 0x24 0x2c 0x49 0x8b
  0x00007ff6fb094ccd: 0xd0 0x66 0x90 0xe8 0xbb 0xb0 0xe4 0xfb 0x90 0x8b 0x5c 0x24 0x2c 0x8b 0x4c 0x24
  0x00007ff6fb094cdd: 0x34 0x4c 0x8b 0x44 0x24 0x08 0x8b 0x44 0x24 0x1c 0x45 0x8b 0x4c 0xc6 0x0c 0x0f
  0x00007ff6fb094ced: 0x1f 0x40 0x00 0x45 0x85 0xc9 0x75 0x9b 0xe9 0x4c 0x00 0x00 0x00 0x48 0x8b 0x54
  0x00007ff6fb094cfd: 0x24 0x20 0xc7 0x42 0x08 0x00 0x00 0x00 0x00 0x4c 0x8b 0x42 0x10 0x4c 0x63 0x4a
  0x00007ff6fb094d0d: 0x20 0x4d 0x03 0xc8 0x4c 0x89 0x4a 0x10 0xc7 0x42 0x20 0x00 0x00 0x00 0x00 0x48

Top of stack (sp=0x000000dee597eb30):
  0x000000dee597eb10: 0x000001eccecffd00 0x000001eccecfdb10 0x000036e500004bb8 0x00007ff6fb094cd5
> 0x000000dee597eb30: 0x000001ecb3b262b0 0x000001eccecfdb10 0x000001eccecfdbd0 0x060dfb62060dfb7a
  0x000000dee597eb50: 0x000001eccecffc08 0x0000059efb0a73d7 0x00001ffcf7176d60 0x00007ff6fb0973e3
  0x000000dee597eb70: 0x0000000500000004 0x000001ecb3a4b878 0x000001eccecfdb48 0x00007ff6fb0a9b37
  0x000000dee597eb90: 0x000001eccecffc08 0x000001eccecea430 0xffffffca40e75c29 0x00007ff6fb0a7c30
  0x000000dee597ebb0: 0x000001eccecfff20 0x000001eccecfdb48 0x000001eccecffc08 0x00007ff6f70fbfa4
  0x000000dee597ebd0: 0xffffffdc00004bb8 0x000001eccec54d70 0x000001eccecffc08 0x000001eccecea430
  0x000000dee597ebf0: 0x000001eccecffc08 0x00007ff6fb0a83c5 0x000001eccecffd00 0x00007ff6f70fbede
  0x000000dee597ec10: 0x000001eccece9708 0x060c01c3f70c0946 0x000001eccec00e18 0x000001eccecfdb48
  0x000000dee597ec30: 0x000001ec00000ccb 0x00007ff6fb0a7235 0x000001ecb4f97af8 0x000001ecb56a4a48
  0x000000dee597ec50: 0x000001eccecfdb48 0x00007ff6fb0a715f 0x000001eccecea430 0x000001eccecfdb48
  0x000000dee597ec70: 0x000001eccecfdb48 0x00007ff6f6f19917 0x000001eccecfdb10 0x000001eccecfdb48
  0x000000dee597ec90: 0x000001eccecea430 0x00007ff6f6f1a9f2 0x000001ecb56a45d8 0x000001eccecfdb10
  0x000000dee597ecb0: 0x000001eccaae69d0 0x000001eccece85e0 0x000001eccecea430 0x00007ff6f6c227f7
  0x000000dee597ecd0: 0x0039006200330061 0x0031003200330038 0x0031003100660066 0x0030003100320031
  0x000000dee597ecf0: 0x000001eccece85e0 0x02a6182700350039 0x000001ecca015b10 0x0037003000310032
  0x000000dee597ed10: 0x0000000000000000 0x00007ff6f6c15ebf 0x000001ecca04ec08 0x00007ff6f93e0cd9

VM thread locals for the failing thread 0x000001ec9c943dc0:
  0: JNIThreadLocalEnvironment.jniFunctions = (bytes) 0x000001ecb38e8008
  8: StackOverflowCheckImpl.stackBoundaryTL = (Word) 0x0000000000000001 (1)
  16: Safepoint.safepointRequested = (int) 0x7530e2c1 (1966138049)
  20: StatusSupport.statusTL = (int) 0x00000001 (1)
  24: ThreadLocalAllocation.regularTLAB = (bytes)
    0x000001ec9c943dd8: 0x000001eccea80000 0x000001ecceb00000
    0x000001ec9c943de8: 0x000001ecceaa51e0 0x000001ecd60de000
  56: JavaFrameAnchors.lastAnchor = (Word) 0x0000000000000000 (0)
  64: PlatformThreads.currentVThreadId = (long) 0x0000000000000001 (1)
  72: PlatformThreads.currentThread = (Object) 0x000001ecb44cf578
    is an object of type java.lang.Thread
  80: ActionOnExitSafepointSupport.returnIP = (Word) 0x0000000000000000 (0)
  88: ActionOnExitSafepointSupport.returnSP = (Word) 0x0000000000000000 (0)
  96: SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes) 0x0000000000000000
  104: ThreadLocalAllocation.allocatedBytes = (Word) 0x0000000024348430 (607421488)
  112: VMThreads.IsolateTL = (Word) 0x000001ec9e600000 (2115781001216)
  120: VMThreads.OSThreadHandleTL = (Word) 0x0000000000000144 (324)
  128: VMThreads.OSThreadIdTL = (Word) 0x0000000000007f88 (32648)
  136: VMThreads.StackBase = (Word) 0x000000dee5980000 (957334683648)
  144: VMThreads.StackEnd = (Word) 0x000000dee5880000 (957333635072)
  152: VMThreads.StartedByCurrentIsolate = (bytes) 0x0000000000000000
  160: VMThreads.nextTL = (Word) 0x0000000000000000 (0)
  168: VMThreads.unalignedIsolateThreadMemoryTL = (Word) 0x000001ec9c943db0 (2115750870448)
  176: ExceptionUnwind.currentException = (Object) 0x0000000000000000
  180: IsolatedCompileClient.currentClient = (Object) 0x0000000000000000
  184: IsolatedCompileContext.currentContext = (Object) 0x0000000000000000
  188: JNIObjectHandles.handles = (Object) 0x000001eccb0206f0
    is an object of type com.oracle.svm.core.handles.ThreadLocalHandles
  192: JNIThreadLocalPendingException.pendingException = (Object) 0x0000000000000000
  196: JNIThreadLocalReferencedObjects.referencedObjectsListHead = (Object) 0x0000000000000000
  200: JNIThreadOwnedMonitors.ownedMonitors = (Object) 0x0000000000000000
  204: NoAllocationVerifier.openVerifiers = (Object) 0x0000000000000000
  208: ThreadingSupportImpl.activeTimer = (Object) 0x0000000000000000
  212: ActionOnExitSafepointSupport.actionTL = (int) 0x00000000 (0)
  216: ActionOnTransitionToJavaSupport.actionTL = (int) 0x00000000 (0)
  220: ImplicitExceptions.implicitExceptionsAreFatal = (int) 0x00000000 (0)
  224: StackOverflowCheckImpl.yellowZoneStateTL = (int) 0x7efefefe (2130640638)
  228: StatusSupport.safepointBehaviorTL = (int) 0x00000001 (1)
  232: ThreadingSupportImpl.currentPauseDepth = (int) 0x00000000 (0)

Java frame anchors for the failing thread 0x000001ec9c943dc0:
  No anchors

Stacktrace for the failing thread 0x000001ec9c943dc0 (A=AOT compiled, J=JIT compiled, D=deoptimized, i=inlined):
  A  SP 0x000000dee597eb30 IP 0x00007ff6fb094c1d size=64    org.msgpack.core.MessagePacker.flushBuffer(MessagePacker.java)
  i  SP 0x000000dee597eb70 IP 0x00007ff6fb0973e3 size=64    org.msgpack.core.MessagePacker.ensureCapacity(MessagePacker.java:321)
  A  SP 0x000000dee597eb70 IP 0x00007ff6fb0973e3 size=64    org.msgpack.core.MessagePacker.writeByteAndFloat(MessagePacker.java:362)
  i  SP 0x000000dee597ebb0 IP 0x00007ff6fb0a7c30 size=80    org.msgpack.core.MessagePacker.packFloat(MessagePacker.java:633)
  A  SP 0x000000dee597ebb0 IP 0x00007ff6fb0a7c30 size=80    org.msgpack.jackson.dataformat.MessagePackGenerator.pack(MessagePackGenerator.java:215)
  A  SP 0x000000dee597ec00 IP 0x00007ff6fb0a83c5 size=64    org.msgpack.jackson.dataformat.MessagePackGenerator.packArray(MessagePackGenerator.java:306)
  A  SP 0x000000dee597ec40 IP 0x00007ff6fb0a7235 size=32    org.msgpack.jackson.dataformat.MessagePackGenerator.flush(MessagePackGenerator.java:524)
  A  SP 0x000000dee597ec60 IP 0x00007ff6fb0a715f size=32    org.msgpack.jackson.dataformat.MessagePackGenerator.close(MessagePackGenerator.java:505)
  A  SP 0x000000dee597ec80 IP 0x00007ff6f6f19917 size=32    com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4816)
  A  SP 0x000000dee597eca0 IP 0x00007ff6f6f1a9f2 size=48    com.fasterxml.jackson.databind.ObjectMapper.writeValueAsBytes(ObjectMapper.java:4077)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant