pml-lang / pml-companion

Java source code of the 'PML Companion (PMLC)'
https://www.pml-lang.dev
GNU General Public License v2.0
22 stars 1 forks source link

PMLC v3.1.0 Segfault on Linux #89

Closed sh4r1k7 closed 2 years ago

sh4r1k7 commented 2 years ago

Description Immediate segfault on startup.

Reproducing Download standalone pmlc binary v3.1.0. Run pmlc.

Expected vs actual behavior Expect the app to run. Actually segfaults.

Application version PMLC v3.1.0 (standalone)

Your OS name and version Arch Linux (Garuda)

Linux 5.18.3-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Thu, 09 Jun 2022 16:14:13 +0000 x86_64 GNU/Linux
openjdk 18.0.1.1 2022-04-22
OpenJDK Runtime Environment (build 18.0.1.1+2)
OpenJDK 64-Bit Server VM (build 18.0.1.1+2, mixed mode)

Log

❯ pmlc

[ [ SubstrateSegfaultHandler caught a segfault in thread 0x000000000b3cec00 ] ]
siginfo: si_signo: 11, si_code: 1, si_addr: 0x00000000000000e5

Current timestamp: 1665367364174

General purpose register values:
  RAX 0x0000000000000072 is an unknown value
  RBX 0x000000000b3cefd0 is an unknown value
  RCX 0x0000000000000000
  RDX 0x0000000000000072 is an unknown value
  RBP 0x00007f6eca5f42a0 is an unknown value
  RSI 0x00007f6eca5f4481 is an unknown value
  RDI 0x000000000b3cefd1 is an unknown value
  RSP 0x00007fff735ac2c0 points into the stack for thread 0x000000000b3cec00
  R8  0x00007f6eca5f449c is an unknown value
  R9  0x0000000000000000
  R10 0x0000000000001000 is an unknown value
  R11 0x0000000000000246 is an unknown value
  R12 0x00007fff735ac310 points into the stack for thread 0x000000000b3cec00
  R13 0x000000000b3cf3cf is an unknown value
  R14 0x0000000000000400 is an unknown value
  R15 0x000000000b3cefd0 is an unknown value
  EFL 0x0000000000010246 is an unknown value
  RIP 0x00007f6eca830ec5 is an unknown value

Printing Instructions (ip=0x00007f6eca830ec5):
  0x00007f6eca830ea5: 0x41 0x80 0x7d 0x00 0xff 0x0f 0x85 0xbc 0x00 0x00 0x00 0x48 0x8b 0x05 0xa1 0xfe
  0x00007f6eca830eb5: 0x0b 0x00 0x49 0x0f 0xbe 0x17 0x4c 0x89 0xfb 0x64 0x48 0x8b 0x08 0x48 0x89 0xd0
  0x00007f6eca830ec5: 0xf6 0x44 0x51 0x01 0x20 0x74 0x17 0x0f 0x1f 0x40 0x00 0x48 0x0f 0xbe 0x53 0x01
  0x00007f6eca830ed5: 0x48 0x83 0xc3 0x01 0x48 0x89 0xd0 0xf6 0x44 0x51 0x01 0x20 0x75 0xed 0x84 0xc0

Top of stack (sp=0x00007fff735ac2c0):
  0x00007fff735ac2c0: 0x00007f6e00000000 0x000000000b3cefd0
  0x00007fff735ac2d0: 0x0000000000000400 0x00007f6eca5f42a0
  0x00007fff735ac2e0: 0x000000000b3cd830 0x0000000000000400
  0x00007fff735ac2f0: 0x00007fff735ac310 0x00007f6eca835d8d
  0x00007fff735ac300: 0x0000000009734b40 0x00000000ca775bf3
  0x00007fff735ac310: 0x0000000000000000 0x12f852641483b600
  0x00007fff735ac320: 0x00000000000003e8 0x00000000000003e8
  0x00007fff735ac330: 0x00007f6eca5f42a0 0x0000000009734b40
  0x00007fff735ac340: 0x0000000000000400 0x000000000b3cefd0
  0x00007fff735ac350: 0x00000000000003e8 0x00007f6eca836016
  0x00007fff735ac360: 0x00007fff735ac3d8 0x000000000b3cd830
  0x00007fff735ac370: 0x0000000003bed921 0x00000000000003e8
  0x00007fff735ac380: 0x0000000000000400 0x0000000009734b40
  0x00007fff735ac390: 0x00000000000003e8 0x000000000b3cefd0
  0x00007fff735ac3a0: 0x000000000b3cd830 0x0000000003b77053
  0x00007fff735ac3b0: 0xffffffffffffffb0 0x0000000000000000
  0x00007fff735ac3c0: 0x0000000000000000 0x00007fff735ac430
  0x00007fff735ac3d0: 0x00007f6ecb310918 0x000000000b3d05a0
  0x00007fff735ac3e0: 0x00007f6eca835fc0 0x12f852641483b600
  0x00007fff735ac3f0: 0x000000004e800000 0x00000000000003e8
  0x00007fff735ac400: 0x0000000009734b40 0x0000000000000400
  0x00007fff735ac410: 0x00007fff735ac430 0x00007f6ecb500000
  0x00007fff735ac420: 0x000000000b3cec00 0x0000000003b76ddb
  0x00007fff735ac430: 0x0000000043400000 0x12f852641483b600
  0x00007fff735ac440: 0x0000000002717570 0x00007f6ece633cf8
  0x00007fff735ac450: 0x00000000008cd5be 0x00007fff735ac480
  0x00007fff735ac460: 0x00007f6ecb500000 0x00000000008cd5d1
  0x00007fff735ac470: 0x00007fff735ac500 0x0000000002a2fe79
  0x00007fff735ac480: 0x00000000008cd5be 0x00007fff735ac470
  0x00007fff735ac490: 0x0000000000000000 0x00007f6ece646868
  0x00007fff735ac4a0: 0x00007f6ecd4b1d50 0x00000000008b6896
  0x00007fff735ac4b0: 0x000000100000000f 0x00007f6ecdf34798

DeoptStubPointer address: 0x000000000083b7b0

Top frame info:
  Does not look like a Java Frame. Use JavaFrameAnchors to find LastJavaSP:
  Found matching Anchor:0x00007fff735ac480
  LastJavaSP 0x00007fff735ac470
  LastJavaIP 0x00000000008cd5be

Threads:
  0x00007f6ec4000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x00007f6ecde96138, daemon, stack(0x00007f6ecab01000,0x00007f6ecb300000)
  0x000000000b3cec00 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "main" - 0x00007f6ecde96080, stack(0x00007fff72db1000,0x00007fff735ae000)

VM thread locals for the failing thread 0x000000000b3cec00:
  0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes)
    0x000000000b3cec00: 0x00007f6ecd8b5010
  8 (8 bytes): SubstrateFastThreadLocal.CONTEXT = (Object) null
  16 (8 bytes): SubstrateThreadLocalHandshake.STATE = (Object) null
  24 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
  32 (4 bytes): Safepoint.safepointRequested = (int) 2147449334 (0x7fff79f6)
  36 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
  40 (4 bytes): SubstrateThreadLocalHandshake.PENDING = (int) 0 (0x00000000)
  48 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes)
    0x000000000b3cec30: 0x00007f6ecb300000 0x00007f6ecb400000
    0x000000000b3cec40: 0x00007f6ecb320ae0 0x0000000000000000
  80 (8 bytes): PlatformThreads.currentThread = (Object) java.lang.Thread (0x00007f6ecde96080)
  88 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 140735128716416 (0x00007fff735ac480)
  96 (8 bytes): AccessControlContextStack = (Object) java.util.ArrayDeque (0x00007f6ecb302298)
  104 (8 bytes): ExceptionUnwind.currentException = (Object) null
  112 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) java.util.SplittableRandom (0x00007f6ecb308258)
  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 (0x00007f6ecb3011f0)
  144 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
  152 (8 bytes): JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
  160 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  168 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
  176 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) null
  184 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes)
    0x000000000b3cecb8: 0x0000000000000000
  192 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 0 (0x0000000000000000)
  200 (8 bytes): VMThreads.IsolateTL = (Word) 140113834147840 (0x00007f6ecb500000)
  208 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 188536960 (0x000000000b3cd880)
  216 (8 bytes): VMThreads.OSThreadIdTL = (Word) 188536960 (0x000000000b3cd880)
  224 (8 bytes): VMThreads.StackBase = (Word) 140735128723456 (0x00007fff735ae000)
  232 (8 bytes): VMThreads.StackEnd = (Word) 140735120347136 (0x00007fff72db1000)
  240 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes)
    0x000000000b3cecf0: 0x0000000000000000
  248 (8 bytes): VMThreads.nextTL = (Word) 0 (0x0000000000000000)
  256 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 188541952 (0x000000000b3cec00)
  264 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
  268 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
  272 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
  276 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
  280 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
  284 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 0 (0x00000000)

No VMOperation in progress

The 15 most recent VM operation status changes (oldest first):

The 20 most recent RuntimeCodeInfo operations (oldest first):

RuntimeCodeInfoMemory contains 0 methods:

Recent deoptimization events (oldest first):

Counters:

Java frame anchors for the failing thread 0x000000000b3cec00:
  Anchor 0x00007fff735ac480 LastJavaSP 0x00007fff735ac470 LastJavaIP 0x00000000008cd5be

Stacktrace for the failing thread 0x000000000b3cec00:
  SP 0x00007fff735ac2c0 IP 0x00007f6eca830ec5  IP is not within Java code. Trying frame anchor of last Java frame instead.
  SP 0x00007fff735ac470 IP 0x00000000008cd5be  [image code] com.oracle.svm.core.posix.headers.Pwd.getpwuid(Pwd.java)
  SP 0x00007fff735ac470 IP 0x00000000008cd5be  [image code] com.oracle.svm.core.posix.PosixSystemPropertiesSupport.userHomeValue(PosixSystemPropertiesSupport.java:52)
  SP 0x00007fff735ac4b0 IP 0x00000000008b6896  [image code] com.oracle.svm.core.jdk.SystemPropertiesSupport.userHome(SystemPropertiesSupport.java:239)
  SP 0x00007fff735ac4b0 IP 0x00000000008b6896  [image code] com.oracle.svm.core.jdk.SystemPropertiesSupport$$Lambda$c08be315aa20ccffc6d99c8ceeebd4e4a45b68c0.get(Unknown Source)
  SP 0x00007fff735ac4d0 IP 0x00000000008b6fb1  [image code] com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:217)
  SP 0x00007fff735ac510 IP 0x00000000008b6e63  [image code] com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:170)
  SP 0x00007fff735ac530 IP 0x000000000273b8d4  [image code] java.lang.System.getProperty(System.java:303)
  SP 0x00007fff735ac550 IP 0x000000000265f512  [image code] dev.pp.basics.utilities.os.OSDirectories.<clinit>(OSDirectories.java:11)
  SP 0x00007fff735ac580 IP 0x00000000007ea20b  [image code] com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:361)
  SP 0x00007fff735ac590 IP 0x00000000007e8a09  [image code] com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:277)
  SP 0x00007fff735aca90 IP 0x000000000265a7ce  [image code] dev.pp.basics.utilities.directory.DirectoryConfig.userDirectoryForApplication(DirectoryConfig.java:71)
  SP 0x00007fff735acae0 IP 0x0000000002659234  [image code] dev.pp.basics.utilities.directory.DirectoryConfig.userConfigDirectoryForApplication(DirectoryConfig.java:58)
  SP 0x00007fff735acb10 IP 0x000000000262eab0  [image code] dev.pmlc.ext.PMLCResources.<clinit>(PMLCResources.java:18)
  SP 0x00007fff735acb40 IP 0x00000000007ea20b  [image code] com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:361)
  SP 0x00007fff735acb50 IP 0x00000000007e8a09  [image code] com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:277)
  SP 0x00007fff735ad050 IP 0x00000000025e39b3  [image code] dev.pmlc.commands.Start.init(Start.java:31)
  SP 0x00007fff735ad070 IP 0x00000000025e39f8  [image code] dev.pmlc.commands.Start.main(Start.java:14)
  SP 0x00007fff735ad090 IP 0x00000000007d66a3  [image code] com.oracle.svm.core.JavaMainWrapper.runCore0(JavaMainWrapper.java:166)
  SP 0x00007fff735ad0b0 IP 0x00000000007d6445  [image code] com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:130)
  SP 0x00007fff735ad0b0 IP 0x00000000007d6445  [image code] com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:214)
  SP 0x00007fff735ad0e0 IP 0x000000000082738b  [image code] com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(IsolateEnterStub.java:0)

VM mutexes:
  mutex "mainVMOperationControlWorkQueue" is unlocked.
  mutex "referencePendingList" is unlocked.
  mutex "thread" is unlocked.

AOT compiled code is mapped at 0x0000000000403000 - 0x0000000003ae7bbf

Heap settings and statistics:
  Supports isolates: true
  Heap base: 0x00007f6ecb500000
  Object reference size: 8
  Aligned chunk size: 1048576
  Incremental collections: 0
  Complete collections: 0

Native image heap boundaries:
  ReadOnly Primitives: 0x00007f6ecb601028 - 0x00007f6eccda6770
  ReadOnly References: 0x00007f6eccda6770 - 0x00007f6ecd8b49d0
  ReadOnly Relocatables: 0x00007f6ecd8b5000 - 0x00007f6ecdc96400
  Writable Primitives: 0x00007f6ecdc97000 - 0x00007f6ecddb5c38
  Writable References: 0x00007f6ecddb5c38 - 0x00007f6ecebe52c0
  Writable Huge: 0x00007f6ecec00030 - 0x00007f6ececde7c8
  ReadOnly Huge: 0x00007f6ececdf030 - 0x00007f6ed110ca80

Heap:
  Young generation:
    Eden:
      edenSpace:
        aligned: 0/0 unaligned: 0/0
    Survivors:
      Survivor-1 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-1 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-3 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-3 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 To:
        aligned: 0/0 unaligned: 0/0
  Old generation:
    oldFromSpace:
      aligned: 0/0 unaligned: 0/0
    oldToSpace:
      aligned: 0/0 unaligned: 0/0

  Unused:
    aligned: 0/0

Segfault detected, aborting process. Use runtime option -R:-InstallSegfaultHandler if you don't want to use SubstrateSegfaultHandler.
pml-lang commented 2 years ago

This seams to be a problem of the underlying JVM libraries used to execute PMLC on your OS. Could you please open a new issue and use the 'Bug report' template, and add information to reproduce the bug? Did you use the standalone executable or the jar files to run PMLC?

sh4r1k7 commented 2 years ago

Updated with template, I added my java version info. Let me know what other info I can provide to help.

pml-lang commented 2 years ago

I've just re-tested PMLC 3.1.0 (standalone version) on Ubuntu 20.04, and it works fine:

~$ ./pmlc version
PMLC 3.1.0 2022-10-03

I can't reproduce your issue.

I found this similar error message which hints that the problem is probably caused by GraalVM (which is used to create the PMLC executable).

If possible I would suggest to:

sh4r1k7 commented 2 years ago

Hello, yes the jar files work fine.

I'm happy to use this workaround. I'll leave it to you whether you want to close this issue (I tried the standalone with java 18.0.2 but same problem).

pml-lang commented 2 years ago

the jar files work fine

Good news. Thanks for letting me know.

I'll leave it to you whether you want to close this issue

I'll close this issue because it's related to GraalVM, not to PMLC. Let's hope that the problem will be solved in a new version of GraalVM.