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

22.3.0 CE native build crashes #5303

Closed
lowecg opened this issue Oct 26, 2022 · 32 comments
Closed

22.3.0 CE native build crashes #5303

lowecg opened this issue Oct 26, 2022 · 32 comments
Assignees

Comments

@lowecg
Copy link

lowecg commented Oct 26, 2022

Describe the issue
I’m trying to build a Clojure-based lambda using the native image compilation, but the build immediately crashes with the following:
Fatal error: Failed while initializing the performance data.

Steps to reproduce the issue
Please include both build steps as well as run steps

  1. run docker
  2. install Babashka
  3. git clone --depth 1 https://github.com/lowecg/graalvm-build-test
  4. bb hl:compile && bb hl:native:executable

Describe GraalVM and your environment:

  • GraalVM version: 22.3.0 CE
  • JDK major version: 17
  • OS: macOS Monterey 12.6, Apple Silicon
  • Architecture: AARCH64

More details
I’m trying to build a Clojure-based lambda using the native image compilation, but the build immediately crashes with:
Fatal error: Failed while initializing the performance data.

Fatal error: Failed while initializing the performance data.

Current timestamp: 1666775189252

Printing Instructions (ip=0x00000000004a61f4):
  0x00000000004a61d4: 0xe0 0x03 0x40 0xb2 0x80 0x07 0x00 0xf9 0xc0 0xdf 0x9f 0x52 0xc0 0xdf 0xaf 0x72
  0x00000000004a61e4: 0x80 0x37 0x01 0xb9 0xe0 0x17 0x40 0xf9 0xe1 0x8b 0x41 0xa9 0x54 0xff 0xff 0x97
  0x00000000004a61f4: 0x1f 0x20 0x03 0xd5 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xff 0x03 0x01 0xd1
  0x00000000004a6204: 0xfd 0x7b 0x03 0xa9 0x82 0x07 0x40 0xf9 0xff 0x63 0x22 0xeb 0x29 0x05 0x00 0x54

Top of stack (sp=0x0000ffff9d6fe770):
  0x0000ffff9d6fe770: 0x0000ffff9d6ff1f0 0x0000ffffda324680
  0x0000ffff9d6fe780: 0x0000ffff9d6fe9e0 0x0000ffff9e621658
  0x0000ffff9d6fe790: 0x0000ffff9e300000 0x00000000004db72c
  0x0000ffff9d6fe7a0: 0x0000ffff9d6fe9e0 0x000000000050fcd8
  0x0000ffff9d6fe7b0: 0x00000000004f1888 0x0000ffff9d6fe790
  0x0000ffff9d6fe7c0: 0x0000ffff9eb1f328 0x0000ffff9e97bf08
  0x0000ffff9d6fe7d0: 0x0000ffff9d6fe9e0 0x00000000004db72c
  0x0000ffff9d6fe7e0: 0x0000ffff9e8ed008 0x00000000004f2de0
  0x0000ffff9d6fe7f0: 0x0000ffff9d6fe7c0 0x0000000000000000
  0x0000ffff9d6fe800: 0x0000ffff9eacbe58 0x0000ffff9e8ed008
  0x0000ffff9d6fe810: 0x0000ffff9d6fe9e0 0x00000000004db790
  0x0000ffff9d6fe820: 0x0000ffff9d6fe9e0 0x000000000048b0c0
  0x0000ffff9d6fe830: 0x0000ffff9d6fe9e0 0x0000ffff9e8bc3d8
  0x0000ffff9d6fe840: 0x0000ffff9eb1f548 0x0000ffff9e8ed008
  0x0000ffff9d6fe850: 0x0000ffff9d6fe9e0 0x000000000050605c
  0x0000ffff9d6fe860: 0x0000ffff9d6ff1f0 0x0000000000000000
  0x0000ffff9d6fe870: 0x0000ffff9d6fe9e0 0x0000ffff9e8ed008
  0x0000ffff9d6fe880: 0x0000ffff9e9b44a0 0x0000000000000002
  0x0000ffff9d6fe890: 0x0000ffff9d6fe9e0 0x00000000004f2c8c
  0x0000ffff9d6fe8a0: 0x0000000000000000 0x0000ffff9e300000
  0x0000ffff9d6fe8b0: 0x0000000100000000 0x0000000000000002
  0x0000ffff9d6fe8c0: 0x0000ffff9d6fe9e0 0x0000000000454c60
  0x0000ffff9d6fe8d0: 0x0000000000000000 0x0000000000000000
  0x0000ffff9d6fe8e0: 0x0000000000000000 0x0000000000000000
  0x0000ffff9d6fe8f0: 0x0000000000000000 0x000000000c973e30
  0x0000ffff9d6fe900: 0x0000000000000000 0x0000000000000000
  0x0000ffff9d6fe910: 0x0000000000000000 0x0000000000000000
  0x0000ffff9d6fe920: 0x0000000000000000 0x0000000000000000
  0x0000ffff9d6fe930: 0x0000000000000000 0x0000000000000000
  0x0000ffff9d6fe940: 0x0000000000000000 0x0000000000000000
  0x0000ffff9d6fe950: 0x0000000000000000 0x0000000000000000
  0x0000ffff9d6fe960: 0x0000000000000000 0x0000000000000000

Top frame info:
  TotalFrameSize in CodeInfoTable 64

Threads:
  0x0000ffff90000b40 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "Performance data" - 0x0000ffff9e8ed008, daemon, stack(0x0000ffff9cf01000,0x0000ffff9d700000)
  0x0000ffff98000b40 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x0000ffff9e8eda78, daemon, stack(0x0000ffff9d901000,0x0000ffff9e100000)
  0x000000000c973940 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "main" - 0x0000ffff9e8ed9b8, stack(0x0000ffffd9b26000,0x0000ffffda325000)

VM thread locals for the failing thread 0x0000ffff90000b40:
  0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes)
    0x0000ffff90000b40: 0x0000ffff9e750010
  8 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
  16 (4 bytes): Safepoint.safepointRequested = (int) 2147469811 (0x7fffc9f3)
  20 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
  24 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes)
    0x0000ffff90000b58: 0x0000ffff9cd00000 0x0000ffff9ce00000
    0x0000ffff90000b68: 0x0000ffff9cd014b0 0x0000000000000000
  56 (8 bytes): PlatformThreads.currentThread = (Object) com.oracle.svm.core.jvmstat.PerfManager$PerfDataThread (0x0000ffff9e8ed008)
  64 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 0 (0x0000000000000000)
  72 (8 bytes): AccessControlContextStack = (Object) null
  80 (8 bytes): ExceptionUnwind.currentException = (Object) null
  88 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) null
  96 (8 bytes): IsolatedCompileClient.currentClient = (Object) null
  104 (8 bytes): IsolatedCompileContext.currentContext = (Object) null
  112 (8 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x0000ffff9cd011c8)
  120 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
  128 (8 bytes): JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
  136 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  144 (8 bytes): JfrThreadLocal.javaEventWriter = (Object) null
  152 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
  160 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) null
  168 (8 bytes): JfrThreadLocal.dataLost = (Word) 0 (0x0000000000000000)
  176 (8 bytes): JfrThreadLocal.javaBuffer = (Word) 0 (0x0000000000000000)
  184 (8 bytes): JfrThreadLocal.nativeBuffer = (Word) 0 (0x0000000000000000)
  192 (8 bytes): JfrThreadLocal.parentThreadId = (long) 1 (0x0000000000000001)
  200 (8 bytes): JfrThreadLocal.threadId = (long) 35 (0x0000000000000023)
  208 (8 bytes): SamplerThreadLocal.localBuffer = (Word) 0 (0x0000000000000000)
  216 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes)
    0x0000ffff90000c18: 0x0000000000000000
  224 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 0 (0x0000000000000000)
  232 (8 bytes): VMThreads.IsolateTL = (Word) 281473335689216 (0x0000ffff9e300000)
  240 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 281473323102704 (0x0000ffff9d6ff1f0)
  248 (8 bytes): VMThreads.OSThreadIdTL = (Word) 281473323102704 (0x0000ffff9d6ff1f0)
  256 (8 bytes): VMThreads.StackBase = (Word) 281473323106304 (0x0000ffff9d700000)
  264 (8 bytes): VMThreads.StackEnd = (Word) 281473314721792 (0x0000ffff9cf01000)
  272 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes)
    0x0000ffff90000c50: 0x0000000000000001
  280 (8 bytes): VMThreads.nextTL = (Word) 281473231883072 (0x0000ffff98000b40)
  288 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 281473097665312 (0x0000ffff90000b20)
  296 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
  300 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
  304 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
  308 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
  312 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
  316 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 0 (0x00000000)

No VMOperation in progress

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

Counters:

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

Stacktrace for the failing thread 0x0000ffff90000b40:
  SP 0x0000ffff9d6fe770 IP 0x00000000004a61f4  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:116)
  SP 0x0000ffff9d6fe770 IP 0x00000000004a61f4  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shouldNotReachHere(VMErrorSubstitutions.java:109)
  SP 0x0000ffff9d6fe7b0 IP 0x000000000050fcd8  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:65)
  SP 0x0000ffff9d6fe7e0 IP 0x00000000004db72c  [image code] com.oracle.svm.core.util.VMError.guarantee(VMError.java:89)
  SP 0x0000ffff9d6fe7e0 IP 0x00000000004db72c  [image code] com.oracle.svm.core.jvmstat.PerfManager$PerfDataThread.initializeMemory(PerfManager.java:208)
  SP 0x0000ffff9d6fe820 IP 0x00000000004db790  [image code] com.oracle.svm.core.jvmstat.PerfManager$PerfDataThread.run(PerfManager.java:187)
  SP 0x0000ffff9d6fe860 IP 0x000000000050605c  [image code] com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  SP 0x0000ffff9d6fe8a0 IP 0x00000000004f2c8c  [image code] com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
  SP 0x0000ffff9d6fe8d0 IP 0x0000000000454c60  [image code] com.oracle.svm.core.code.IsolateEnterStub.PosixPlatformThreads_pthreadStartRoutine_38d96cbc1a188a6051c29be1299afe681d67942e(IsolateEnterStub.java:0)

VM mutexes:
  mutex "thread" is unlocked.
  mutex "SamplerBufferPool" is unlocked.
  mutex "perfDataInitialization" is locked by thread 0x0000ffff90000b40
  mutex "jfrRecorder" is unlocked.
  mutex "referencePendingList" is unlocked.
  mutex "jfrThreadRepository" is unlocked.
  mutex "mainVMOperationControlWorkQueue" is unlocked.

AOT compiled code is mapped at 0x0000000000420000 - 0x0000000000ac32ef

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

Native image heap boundaries:
  ReadOnly Primitives: 0x0000ffff9e401028 - 0x0000ffff9e5a2ed0
  ReadOnly References: 0x0000ffff9e5a2ed0 - 0x0000ffff9e74dd68
  ReadOnly Relocatables: 0x0000ffff9e750000 - 0x0000ffff9e7f8468
  Writable Primitives: 0x0000ffff9e801028 - 0x0000ffff9e888550
  Writable References: 0x0000ffff9e888550 - 0x0000ffff9eb4a900
  Writable Huge: 0x0000ffff9ec00030 - 0x0000ffff9ec29b48
  ReadOnly Huge: 0x0000ffff9ec30030 - 0x0000ffff9edc58b0

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

Fatal error: Failed while initializing the performance data.
@lowecg
Copy link
Author

lowecg commented Oct 26, 2022

We just tried a recent-ish dev build (GraalVM CE 23.0.0-dev-20221020_1959), and the native build succeeded.

@martincalvodaniel
Copy link

I am having this very same issue but it is strange because it only happens at Jenkins.

At local I am being able to build the native image.

That is weird :S

I am using native generation through docker:
-Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:22.3.0-java17

@oubidar-Abderrahim oubidar-Abderrahim self-assigned this Oct 31, 2022
@oubidar-Abderrahim
Copy link
Member

We just tried a recent-ish dev build (GraalVM CE 23.0.0-dev-20221020_1959), and the native build succeeded.

@martincalvodaniel does this build fixes the issue for you too?

@martincalvodaniel
Copy link

We just tried a recent-ish dev build (GraalVM CE 23.0.0-dev-20221020_1959), and the native build succeeded.

@martincalvodaniel does this build fixes the issue for you too?

At local, I am using this image:

22.3.0-java17: Pulling from quarkus/ubi-quarkus-native-image
Digest: sha256:497d8e3081bebf193aed852b327cdf715cf82b6d2fe97de5af2d90a039334c7c

Version info: 'GraalVM 22.3.0 Java 17 CE'
Java version info: '17.0.5+8-jvmci-22.3-b08'
C compiler: gcc (redhat, x86_64, 8.5.0)
Garbage collector: Serial GC

And its working.

At Jenkins I am using that exact digest image and its failing with the very exact message of the PO:

Digest: sha256:497d8e3081bebf193aed852b327cdf715cf82b6d2fe97de5af2d90a039334c7c
Status: Downloaded newer image for quay.io/quarkus/ubi-quarkus-native-image:22.3.0-java17
quay.io/quarkus/ubi-quarkus-native-image:22.3.0-java17
Fatal error: Failed while initializing the performance data.

Current timestamp: 1667299640787

Printing Instructions (ip=0x00000000004889f0):
  0x00000000004889d0: 0x00 0x41 0xc7 0x87 0x34 0x01 0x00 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x7c 0x24
  0x00000000004889e0: 0x20 0x48 0x8b 0x74 0x24 0x10 0x48 0x8b 0x54 0x24 0x18 0xe8 0x60 0xfd 0xff 0xff
  0x00000000004889f0: 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc
  0x0000000000488a00: 0x48 0x83 0xec 0x18 0x49 0x3b 0x67 0x08 0x0f 0x86 0x9f 0x00 0x00 0x00 0x48 0x8b

Top of stack (sp=0x00007f4a17bfedc0):
  0x00007f4a17bfedc0: 0x0000800000008000 0x00000000004cd3d3
  0x00007f4a17bfedd0: 0x00007f4a18b256a8 0x00007f4a18800000
  0x00007f4a17bfede0: 0x00000000004bc4eb 0x00000000004ef524
  0x00007f4a17bfedf0: 0x00007f4a18e7cc68 0x00000000004bc4eb
  0x00007f4a17bfee00: 0x00000000004d1f6b 0x00007f4a18fcbd68
  0x00007f4a17bfee10: 0x00007f4a18dedc80 0x00000000004bc53b
  0x00007f4a17bfee20: 0x00007f4a17bff700 0x00000000004d1809
  0x00007f4a17bfee30: 0x00007f4a18dbd410 0x00007f4a1901f3e8
  0x00007f4a17bfee40: 0x00007f4a18dedc80 0x00000000004e642a
  0x00007f4a17bfee50: 0x00007ffe70baf60f 0x00007f4a18800000
  0x00007f4a17bfee60: 0x00007f4a18dedc80 0x00007f4a18eb5200
  0x00007f4a17bfee70: 0x0000000000000002 0x00000000004d1e17
  0x00007f4a17bfee80: 0x00007f4a18800000 0x0000000100000000
  0x00007f4a17bfee90: 0x0000000000000002 0x000000000043a55f
  0x00007f4a17bfeea0: 0x0000000000000000 0x0000000000000000
  0x00007f4a17bfeeb0: 0x0000000000000000 0x0000000000000000
  0x00007f4a17bfeec0: 0x0000000001d11cb0 0x0000000000000000
  0x00007f4a17bfeed0: 0x00007f4a17bfefc0 0x00007ffe70baf6d0
  0x00007f4a17bfeee0: 0x00007ffe70baf60f 0x00007ffe70baf60e
  0x00007f4a17bfeef0: 0x0000000000000000 0x00007f4a19b551cf
  0x00007f4a17bfef00: 0x0000000000000000 0x00007f4a17bff700
  0x00007f4a17bfef10: 0x00007f4a17bff700 0x7b132a088e28c997
  0x00007f4a17bfef20: 0x00007ffe70baf60e 0x00007ffe70baf60f
  0x00007f4a17bfef30: 0x00007ffe70baf6d0 0x00007f4a17bfefc0
  0x00007f4a17bfef40: 0x858705775028c997 0x858719622cfac997
  0x00007f4a17bfef50: 0x0000000000000000 0x0000000000000000
  0x00007f4a17bfef60: 0x0000000000000000 0x0000000000000000
  0x00007f4a17bfef70: 0x0000000000000000 0x0000000000000000
  0x00007f4a17bfef80: 0x0000000000000000 0x0000000000000000
  0x00007f4a17bfef90: 0x0000000000000000 0xd0fd2c8e9d4ef300
  0x00007f4a17bfefa0: 0x0000000000000000 0x00007f4a17bff700
  0x00007f4a17bfefb0: 0x00007ffe70baf6d0 0x00007f4a193b5dd3

Top frame info:
  TotalFrameSize in CodeInfoTable 48
  
Threads:
  0x00007f4a08000b80 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "Performance data" - 0x00007f4a18dedc80, daemon, stack(0x00007f4a17401000,0x00007f4a17c00000)
  0x00007f4a10000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x00007f4a18dee6f0, daemon, stack(0x00007f4a17e01000,0x00007f4a18600000)
  0x0000000001d11340 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "main" - 0x00007f4a18dee630, stack(0x00007ffe703b2000,0x00007ffe70bb0000)
  
VM thread locals for the failing thread 0x00007f4a08000b80:
  0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes) 
    0x00007f4a08000b80: 0x00007f4a18c53010
  8 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
  16 (4 bytes): Safepoint.safepointRequested = (int) 2147470176 (0x7fffcb60)
  20 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
  24 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes) 
    0x00007f4a08000b98: 0x00007f4a17200000 0x00007f4a17300000
    0x00007f4a08000ba8: 0x00007f4a172014b0 0x0000000000000000
  56 (8 bytes): PlatformThreads.currentThread = (Object) com.oracle.svm.core.jvmstat.PerfManager$PerfDataThread (0x00007f4a18dedc80)
  64 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 0 (0x0000000000000000)
  72 (8 bytes): AccessControlContextStack = (Object) null
  80 (8 bytes): ExceptionUnwind.currentException = (Object) null
  88 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) null
  96 (8 bytes): IsolatedCompileClient.currentClient = (Object) null
  104 (8 bytes): IsolatedCompileContext.currentContext = (Object) null
  112 (8 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x00007f4a172011c8)
  120 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
  128 (8 bytes): JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
  136 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  144 (8 bytes): JfrThreadLocal.javaEventWriter = (Object) null
  152 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
  160 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) null
  168 (8 bytes): JfrThreadLocal.dataLost = (Word) 0 (0x0000000000000000)
  176 (8 bytes): JfrThreadLocal.javaBuffer = (Word) 0 (0x0000000000000000)
  184 (8 bytes): JfrThreadLocal.nativeBuffer = (Word) 0 (0x0000000000000000)
  192 (8 bytes): JfrThreadLocal.parentThreadId = (long) 1 (0x0000000000000001)
  200 (8 bytes): JfrThreadLocal.threadId = (long) 41 (0x0000000000000029)
  208 (8 bytes): SamplerThreadLocal.localBuffer = (Word) 0 (0x0000000000000000)
  216 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes) 
    0x00007f4a08000c58: 0x0000000000000000
  224 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 0 (0x0000000000000000)
  232 (8 bytes): VMThreads.IsolateTL = (Word) 139956215349248 (0x00007f4a18800000)
  240 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 139956202764032 (0x00007f4a17bff700)
  248 (8 bytes): VMThreads.OSThreadIdTL = (Word) 139956202764032 (0x00007f4a17bff700)
  256 (8 bytes): VMThreads.StackBase = (Word) 139956202766336 (0x00007f4a17c00000)
  264 (8 bytes): VMThreads.StackEnd = (Word) 139956194381824 (0x00007f4a17401000)
  272 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes) 
    0x00007f4a08000c90: 0x0000000000000001
  280 (8 bytes): VMThreads.nextTL = (Word) 139956072745856 (0x00007f4a10000b80)
  288 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 139955938528096 (0x00007f4a08000b60)
  296 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
  300 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
  304 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
  308 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
  312 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
  316 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 0 (0x00000000)
  
No VMOperation in progress

The 15 most recent VM operation status changes (oldest first):
  
Counters:
  
Java frame anchors for the failing thread 0x00007f4a08000b80:
  No anchors
  
Stacktrace for the failing thread 0x00007f4a08000b80:
  SP 0x00007f4a17bfedc0 IP 0x00000000004889f0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:116)
  SP 0x00007f4a17bfedc0 IP 0x00000000004889f0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shouldNotReachHere(VMErrorSubstitutions.java:109)
  SP 0x00007f4a17bfedf0 IP 0x00000000004ef524  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:65)
  SP 0x00007f4a17bfee00 IP 0x00000000004bc4eb  [image code] com.oracle.svm.core.util.VMError.guarantee(VMError.java:89)
  SP 0x00007f4a17bfee00 IP 0x00000000004bc4eb  [image code] com.oracle.svm.core.jvmstat.PerfManager$PerfDataThread.initializeMemory(PerfManager.java:208)
  SP 0x00007f4a17bfee20 IP 0x00000000004bc53b  [image code] com.oracle.svm.core.jvmstat.PerfManager$PerfDataThread.run(PerfManager.java:187)
  SP 0x00007f4a17bfee50 IP 0x00000000004e642a  [image code] com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  SP 0x00007f4a17bfee80 IP 0x00000000004d1e17  [image code] com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
  SP 0x00007f4a17bfeea0 IP 0x000000000043a55f  [image code] com.oracle.svm.core.code.IsolateEnterStub.PosixPlatformThreads_pthreadStartRoutine_38d96cbc1a188a6051c29be1299afe681d67942e(IsolateEnterStub.java:0)
  
VM mutexes:
  mutex "thread" is unlocked.
  mutex "referencePendingList" is unlocked.
  mutex "jfrThreadRepository" is unlocked.
  mutex "perfDataInitialization" is locked by thread 0x00007f4a08000b80
  mutex "mainVMOperationControlWorkQueue" is unlocked.
  mutex "jfrRecorder" is unlocked.
  mutex "SamplerBufferPool" is unlocked.
  
AOT compiled code is mapped at 0x0000000000406000 - 0x0000000000a7e3cf

Heap settings and statistics:
  Supports isolates: true
  Heap base: 0x00007f4a18800000
  Object reference size: 8
  Aligned chunk size: 1048576
  Incremental collections: 0
  Complete collections: 0
  
Native image heap boundaries:
  ReadOnly Primitives: 0x00007f4a18901028 - 0x00007f4a18aa4150
  ReadOnly References: 0x00007f4a18aa4150 - 0x00007f4a18c52688
  ReadOnly Relocatables: 0x00007f4a18c53000 - 0x00007f4a18d01840
  Writable Primitives: 0x00007f4a18d02000 - 0x00007f4a18d89588
  Writable References: 0x00007f4a18d89588 - 0x00007f4a1904ae50
  Writable Huge: 0x00007f4a19100030 - 0x00007f4a19129d60
  ReadOnly Huge: 0x00007f4a1912a030 - 0x00007f4a192beb98

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

Fatal error: Failed while initializing the performance data.

> Task :parent-module:app:quarkusBuild FAILED

FAILURE: Build failed with an exception.

@ppalaga
Copy link

ppalaga commented Nov 3, 2022

I also see this occurring on my both home PCs, while it seems to work on GitHub Actions.

The mandrel image works for me as a workaround:

-Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:22.3-java17

@zakkak
Copy link
Collaborator

zakkak commented Nov 4, 2022

We just tried a recent-ish dev build (GraalVM CE 23.0.0-dev-20221020_1959), and the native build succeeded.

Hi @peter-hofer. I was looking into this and noticed 62432ef. Unfortunately I can't reproduce the issue so I can only "look around". Do you think a backport of 62432ef to 22.3 could fix the issue?

@galderz
Copy link
Contributor

galderz commented Nov 7, 2022

I have a very similar env but I'm unable to reproduce it. I'm running Colima docker daemon but the build tool in use here does not like it:

[holy-lambda] Docker is not running! Enable and run docker first before using holy-lambda!

Docker client does work:

$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

Even after setting the DOCKER_HOST env variable it does not work:

$ export DOCKER_HOST="$(docker context inspect colima -f '{{ .Endpoints.docker.Host }}')"
$ bb hl:compile && bb hl:native:executable
[holy-lambda] Docker is not running! Enable and run docker first before using holy-lambda!

@lowecg Can you make this reproducible outside of docker? Or fix holy-lamdba? According to this issue, the code seems to assume that a docker user on macos will have Docker.app install and that I'm afraid is the wrong assumption to make, particularly since Docker requires $$$.

@lowecg
Copy link
Author

lowecg commented Nov 7, 2022

@galderz Noted on the Docker issue. I've put an alternative Docker test into my holy-lambda fork and have updated the repro repo to use it. Please could you try that?

https://github.com/lowecg/graalvm-build-test

@peter-hofer
Copy link
Member

Hi @peter-hofer. I was looking into this and noticed 62432ef. Unfortunately I can't reproduce the issue so I can only "look around". Do you think a backport of 62432ef to 22.3 could fix the issue?

@zakkak, this is indeed intended to be a workaround for this issue, so backporting should help.

We have seen this problem on very rare occasions without being able to pin it down. I believe @christianhaeubl would appreciate if you had a consistent reproducer.

@zakkak
Copy link
Collaborator

zakkak commented Nov 7, 2022

We have seen this problem on very rare occasions without being able to pin it down. I believe @christianhaeubl would appreciate if you had a consistent reproducer.

@peter-hofer Unfortunately I don't have a reproducer either, but I have heard more than a couple of people having this issue with Quarkus.

CCing some of them @rsvoboda, @loicmathieu, @ppalaga, @beikov in case they can provide more details on how to reproduce.

@rsvoboda
Copy link

rsvoboda commented Nov 7, 2022

Just looking into it. I can reproduce the fail on RHEL 8 machine running in OpenStack.
Our jobs related to jdbc / hibernate are failing with

uname -a
Linux rsvoboda-rhel8-playground-xlarge 4.18.0-372.9.1.el8.x86_64 #1 SMP Fri Apr 15 22:12:19 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/redhat-release
Red Hat Enterprise Linux release 8.6 (Ootpa)

Steps to reproduce:

git clone https://github.com/quarkusio/quarkus
cd quarkus
./mvnw clean install -Dquickly

./mvnw -fae -f integration-tests/pom.xml clean package -Denforcer.skip=true -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.native-image-xmx=4g -Dtest-containers -Dstart-containers -pl jpa-postgresql,reactive-pg-client,hibernate-reactive-postgresql,hibernate-reactive-panache
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunner] Using docker to run the native image builder
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunner] Checking image status quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3-java17
22.3-java17: Pulling from quarkus/ubi-quarkus-graalvmce-builder-image
Digest: sha256:771dbac629dfc09dedbec04aa628c2d623f460aee4b1eb15f59d5d1574d59eae
Status: Image is up to date for quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3-java17
quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3-java17
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on   0x00007f658fbfeec0: 0x0000000001dfacb0 0x0000000GraalVM 22.3.0 Java 17 CE (Java Version 17.0.5+8-jvmci-22.3-b08)
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] docker run --env LANG=C --rm --user 600:600 -v /home/hudson/quarkus/integration-tests/jpa-postgresql/target/quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-native-image-source-jar:/project:z --name build-native-vmano quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3-java17 -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Dlogging.initial-configurator.min-level=500 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 --features=org.hibernate.graalvm.internal.QueryParsingSupport,io.quarkus.hibernate.orm.runtime.graal.DisableLoggingFeature,io.quarkus.runner.Feature,io.quarkus.runtime.graal.ResourcesFeature,io.quarkus.runtime.graal.DisableLoggingFeature,io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature,io.quarkus.jdbc.postgresql.runtime.graal.SQLXMLFeature,org.hibernate.graalvm.internal.GraalVMStaticFeature -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -H:PrintAnalysisCallTreeType=CSV -H:+CollectImageBuildStatistics -H:ImageBuildStatisticsFile=quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-runner-timing-stats.json -H:BuildOutputJSONFile=quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-runner-build-output-stats.json -H:+AllowFoldMethods -J-Djava.awt.headless=true --no-fallback --link-at-build-time -H:+ReportExceptionStackTraces -J-Xmx4g -H:-AddAllCharsets --enable-url-protocols=http,https -H:-UseServiceLoaderFeature -H:+StackTrace -J--add-exports=org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-runner -jar quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-runner.jar
Fatal error: Failed while initializing the performance data.

Current timestamp: 1667835292286

Printing Instructions (ip=0x00000000004889f0):
  0x00000000004889d0: 0x00 0x41 0xc7 0x87 0x34 0x01 0x00 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x7c 0x24
  0x00000000004889e0: 0x20 0x48 0x8b 0x74 0x24 0x10 0x48 0x8b 0x54 0x24 0x18 0xe8 0x60 0xfd 0xff 0xff
  0x00000000004889f0: 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc
  0x0000000000488a00: 0x48 0x83 0xec 0x18 0x49 0x3b 0x67 0x08 0x0f 0x86 0x9f 0x00 0x00 0x00 0x48 0x8b
...

@rsvoboda
Copy link

rsvoboda commented Nov 7, 2022

When using local GraalVM (sdk install java 22.3.r17-grl) I have green run :)

So the failures we see are related to the usage of quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3-java17 image builder.

CC @cescoffier, @gsmet

@cescoffier
Copy link

It could be a missing dependency, but I will need to know what new dependency needs to be added to the image (while mandrel does not need it)

@galderz
Copy link
Contributor

galderz commented Nov 7, 2022

@galderz Noted on the Docker issue. I've put an alternative Docker test into my holy-lambda fork and have updated the repro repo to use it. Please could you try that?

https://github.com/lowecg/graalvm-build-test

Still no luck, I don't have aws installed locally (don't think it's relevant for this?):

[holy-lambda] Command <hl:compile>
[holy-lambda] aws command does not exists. Did you install AWS command line application?

@galderz
Copy link
Contributor

galderz commented Nov 7, 2022

When using local GraalVM (sdk install java 22.3.r17-grl) I have green run :)

So the failures we see are related to the usage of quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3-java17 image builder.

CC @cescoffier, @gsmet

I've replicated it using this instructions on my Fedora box /cc @zakkak. If I can only replicate it with builder image, I can quickly build a patched version with the commit that @zakkak thinks might fix it and verify.

@galderz
Copy link
Contributor

galderz commented Nov 7, 2022

Note the instructions that worked to replicate are the ones from previous @rsvoboda comment #5303 (comment).

@lowecg
Copy link
Author

lowecg commented Nov 7, 2022

@galderz Good news that you're able to reproduce the issue with quarkus.

I patched holy-lambda to remove the aws and sam command checks and bumped the repro project. Hopefully, that's enough to build.

@galderz
Copy link
Contributor

galderz commented Nov 8, 2022

FYI I'm trying to verify @zakkak's theory about the patch that might avoid this issue. I'll update when I've found out something.

@galderz
Copy link
Contributor

galderz commented Nov 8, 2022

I think @zakkak's theory has legs. I built vm-22.3.0 tag locally and created a Quarkus builder image with that, and that fails with the crash reported here. I then patched the tag with 62432ef, rebuilt graalvm, rebuilt the Quarkus builder image and the crash is gone (the Quarkus native binary is created without errors).

@galderz
Copy link
Contributor

galderz commented Nov 8, 2022

I've sent a PR to backport the fix to 22.3: #5392

@ppalaga
Copy link

ppalaga commented Nov 9, 2022

Thanks @galderz!

gsmet added a commit to gsmet/quarkus that referenced this issue Nov 10, 2022
Due to a bug in GraalVM, let's default to using Mandrel containers for
now.

See:
- quarkusio#29124
- oracle/graal#5303
gsmet added a commit to gsmet/quarkus that referenced this issue Nov 10, 2022
Due to a bug in GraalVM, let's default to using Mandrel containers for
now.

See:
- quarkusio#29124
- oracle/graal#5303
@zakkak
Copy link
Collaborator

zakkak commented Nov 15, 2022

@peter-hofer @christianhaeubl I think I found a way to reproduce the issue!

Running:

docker run --rm --user 1000:1000 ghcr.io/graalvm/graalvm-ce:22.3.0 gu install native-image

Note the --user 1000:1000 part.

results in:
Fatal error: Failed while initializing the performance data.

Current timestamp: 1668509988470

Printing Instructions (ip=0x00000000004889f0):
  0x00000000004889d0: 0x00 0x41 0xc7 0x87 0x34 0x01 0x00 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x7c 0x24
  0x00000000004889e0: 0x20 0x48 0x8b 0x74 0x24 0x10 0x48 0x8b 0x54 0x24 0x18 0xe8 0x60 0xfd 0xff 0xff
  0x00000000004889f0: 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc
  0x0000000000488a00: 0x48 0x83 0xec 0x18 0x49 0x3b 0x67 0x08 0x0f 0x86 0x9f 0x00 0x00 0x00 0x48 0x8b

Top of stack (sp=0x00007f63038fedc0):
  0x00007f63038fedc0: 0x0000800000008000 0x00000000004cd3d3
  0x00007f63038fedd0: 0x00007f63046256a8 0x00007f6304300000
  0x00007f63038fede0: 0x00000000004bc4eb 0x00000000004ef524
  0x00007f63038fedf0: 0x00007f630497cc68 0x00000000004bc4eb
  0x00007f63038fee00: 0x00000000004d1f6b 0x00007f6304acbd68
  0x00007f63038fee10: 0x00007f63048edc80 0x00000000004bc53b
  0x00007f63038fee20: 0x00007f63038ff700 0x00000000004d1809
  0x00007f63038fee30: 0x00007f63048bd410 0x00007f6304b1f3e8
  0x00007f63038fee40: 0x00007f63048edc80 0x00000000004e642a
  0x00007f63038fee50: 0x00007ffd5593e59f 0x00007f6304300000
  0x00007f63038fee60: 0x00007f63048edc80 0x00007f63049b5200
  0x00007f63038fee70: 0x0000000000000002 0x00000000004d1e17
  0x00007f63038fee80: 0x00007f6304300000 0x0000000100000000
  0x00007f63038fee90: 0x0000000000000002 0x000000000043a55f
  0x00007f63038feea0: 0x0000000000000000 0x0000000000000000
  0x00007f63038feeb0: 0x0000000000000000 0x0000000000000000
  0x00007f63038feec0: 0x0000000001a33c70 0x0000000000000000
  0x00007f63038feed0: 0x00007f63038fefc0 0x00007ffd5593e660
  0x00007f63038feee0: 0x00007ffd5593e59f 0x00007ffd5593e59e
  0x00007f63038feef0: 0x0000000000000000 0x00007f6305a081ca
  0x00007f63038fef00: 0x0000000000000000 0x00007f63038ff700
  0x00007f63038fef10: 0x00007f63038ff700 0xccd93139c629e296
  0x00007f63038fef20: 0x00007ffd5593e59e 0x00007ffd5593e59f
  0x00007f63038fef30: 0x00007ffd5593e660 0x00007f63038fefc0
  0x00007f63038fef40: 0x321f36261829e296 0x321f3a78c4fbe296
  0x00007f63038fef50: 0x0000000000000000 0x0000000000000000
  0x00007f63038fef60: 0x0000000000000000 0x0000000000000000
  0x00007f63038fef70: 0x0000000000000000 0x0000000000000000
  0x00007f63038fef80: 0x0000000000000000 0x0000000000000000
  0x00007f63038fef90: 0x0000000000000000 0xd8d4d0690569f500
  0x00007f63038fefa0: 0x0000000000000000 0x00007f63038ff700
  0x00007f63038fefb0: 0x00007ffd5593e660 0x00007f6304e39e73

Top frame info:
  TotalFrameSize in CodeInfoTable 48
  
Threads:
  0x00007f62f4000b80 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "Performance data" - 0x00007f63048edc80, daemon, stack(0x00007f6303101000,0x00007f6303900000)
  0x00007f62fc000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x00007f63048ee6f0, daemon, stack(0x00007f6303b01000,0x00007f6304300000)
  0x0000000001a33300 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "main" - 0x00007f63048ee630, stack(0x00007ffd5513f000,0x00007ffd5593f000)
  
VM thread locals for the failing thread 0x00007f62f4000b80:
  0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes) 
    0x00007f62f4000b80: 0x00007f6304753010
  8 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
  16 (4 bytes): Safepoint.safepointRequested = (int) 2147470176 (0x7fffcb60)
  20 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
  24 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes) 
    0x00007f62f4000b98: 0x00007f6302f00000 0x00007f6303000000
    0x00007f62f4000ba8: 0x00007f6302f014b0 0x0000000000000000
  56 (8 bytes): PlatformThreads.currentThread = (Object) com.oracle.svm.core.jvmstat.PerfManager$PerfDataThread (0x00007f63048edc80)
  64 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 0 (0x0000000000000000)
  72 (8 bytes): AccessControlContextStack = (Object) null
  80 (8 bytes): ExceptionUnwind.currentException = (Object) null
  88 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) null
  96 (8 bytes): IsolatedCompileClient.currentClient = (Object) null
  104 (8 bytes): IsolatedCompileContext.currentContext = (Object) null
  112 (8 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x00007f6302f011c8)
  120 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
  128 (8 bytes): JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
  136 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  144 (8 bytes): JfrThreadLocal.javaEventWriter = (Object) null
  152 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
  160 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) null
  168 (8 bytes): JfrThreadLocal.dataLost = (Word) 0 (0x0000000000000000)
  176 (8 bytes): JfrThreadLocal.javaBuffer = (Word) 0 (0x0000000000000000)
  184 (8 bytes): JfrThreadLocal.nativeBuffer = (Word) 0 (0x0000000000000000)
  192 (8 bytes): JfrThreadLocal.parentThreadId = (long) 1 (0x0000000000000001)
  200 (8 bytes): JfrThreadLocal.threadId = (long) 41 (0x0000000000000029)
  208 (8 bytes): SamplerThreadLocal.localBuffer = (Word) 0 (0x0000000000000000)
  216 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes) 
    0x00007f62f4000c58: 0x0000000000000000
  224 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 0 (0x0000000000000000)
  232 (8 bytes): VMThreads.IsolateTL = (Word) 140063248744448 (0x00007f6304300000)
  240 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 140063238256384 (0x00007f63038ff700)
  248 (8 bytes): VMThreads.OSThreadIdTL = (Word) 140063238256384 (0x00007f63038ff700)
  256 (8 bytes): VMThreads.StackBase = (Word) 140063238258688 (0x00007f6303900000)
  264 (8 bytes): VMThreads.StackEnd = (Word) 140063229874176 (0x00007f6303101000)
  272 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes) 
    0x00007f62f4000c90: 0x0000000000000001
  280 (8 bytes): VMThreads.nextTL = (Word) 140063111383936 (0x00007f62fc000b80)
  288 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 140062977166176 (0x00007f62f4000b60)
  296 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
  300 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
  304 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
  308 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
  312 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
  316 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 0 (0x00000000)
  
No VMOperation in progress

The 15 most recent VM operation status changes (oldest first):
  
Counters:
  
Java frame anchors for the failing thread 0x00007f62f4000b80:
  No anchors
  
Stacktrace for the failing thread 0x00007f62f4000b80:
  SP 0x00007f63038fedc0 IP 0x00000000004889f0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:116)
  SP 0x00007f63038fedc0 IP 0x00000000004889f0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shouldNotReachHere(VMErrorSubstitutions.java:109)
  SP 0x00007f63038fedf0 IP 0x00000000004ef524  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:65)
  SP 0x00007f63038fee00 IP 0x00000000004bc4eb  [image code] com.oracle.svm.core.util.VMError.guarantee(VMError.java:89)
  SP 0x00007f63038fee00 IP 0x00000000004bc4eb  [image code] com.oracle.svm.core.jvmstat.PerfManager$PerfDataThread.initializeMemory(PerfManager.java:208)
  SP 0x00007f63038fee20 IP 0x00000000004bc53b  [image code] com.oracle.svm.core.jvmstat.PerfManager$PerfDataThread.run(PerfManager.java:187)
  SP 0x00007f63038fee50 IP 0x00000000004e642a  [image code] com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  SP 0x00007f63038fee80 IP 0x00000000004d1e17  [image code] com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
  SP 0x00007f63038feea0 IP 0x000000000043a55f  [image code] com.oracle.svm.core.code.IsolateEnterStub.PosixPlatformThreads_pthreadStartRoutine_38d96cbc1a188a6051c29be1299afe681d67942e(IsolateEnterStub.java:0)
  
VM mutexes:
  mutex "thread" is unlocked.
  mutex "referencePendingList" is unlocked.
  mutex "jfrThreadRepository" is unlocked.
  mutex "perfDataInitialization" is locked by thread 0x00007f62f4000b80
  mutex "mainVMOperationControlWorkQueue" is unlocked.
  mutex "jfrRecorder" is unlocked.
  mutex "SamplerBufferPool" is unlocked.
  
AOT compiled code is mapped at 0x0000000000406000 - 0x0000000000a7e3cf

Heap settings and statistics:
  Supports isolates: true
  Heap base: 0x00007f6304300000
  Object reference size: 8
  Aligned chunk size: 1048576
  Incremental collections: 0
  Complete collections: 0
  
Native image heap boundaries:
  ReadOnly Primitives: 0x00007f6304401028 - 0x00007f63045a4150
  ReadOnly References: 0x00007f63045a4150 - 0x00007f6304752688
  ReadOnly Relocatables: 0x00007f6304753000 - 0x00007f6304801840
  Writable Primitives: 0x00007f6304802000 - 0x00007f6304889588
  Writable References: 0x00007f6304889588 - 0x00007f6304b4ae50
  Writable Huge: 0x00007f6304c00030 - 0x00007f6304c29d60
  ReadOnly Huge: 0x00007f6304c2a030 - 0x00007f6304dbeb98

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

Fatal error: Failed while initializing the performance data.

With the above command I am able to reproduce the issue with both rootless and rootfull docker instances.

Environment:

Docker version 20.10.17, build 100c701
Linux 6.0.7-301.fc37.x86_64
Cgroup Version: 2

@jerboaa
Copy link
Collaborator

jerboaa commented Nov 15, 2022

I think this is reproducible with HelloWorld too. It requires --enable-monitoring=jvmstat to be enabled and then run in a container where System.getProperty("user.name"); resolves to ?. In which case PosixPerfMemoryProvider.create() returns null which seems to cause the crash in 22.3.0.

$ id -u
15263
$ cat TestMe.java 
public class TestMe {
	public static void main(String[] args) {
		String user = System.getProperty("user.name");
		System.out.println("user = '" + user + "'");
	}
}
$ javac TestMe.java
$ native-image --enable-monitoring=jvmstat TestMe
$ sudo docker run --rm -ti --user $(id -u):$(id -u) -v $(pwd):/opt:z fedora:37
bash-5.1$ grep 15263 /etc/passwd
bash-5.1$ /opt/testme 
user = '?'
Fatal error: Failed while initializing the performance data.

Current timestamp: 1668533935765

Printing Instructions (ip=0x0000000000477480):
  0x0000000000477460: 0x00 0xbash-5.1$

The reason why 22.3.0 CE builds crash seems to be because native-image itself is a native image (in contrast to mandrel). Also, on podman an unknown user maps to its id, not causing the crash:

$ podman run --rm -ti --user $(id -u):$(id -u) -v $(pwd):/opt:z fedora:37
bash-5.1$ /opt/testme 
user = '15263'
bash-5.1$ id
uid=15263(15263) gid=15263(15263) groups=15263(15263)
bash-5.1$ grep 15263 /etc/passwd
15263:*:15263:15263:container user:/:/bin/sh
bash-5.1$ 
exit

@gsmet
Copy link

gsmet commented Nov 15, 2022

Should we create a user for the uid we are using in the container?

gsmet added a commit to gsmet/quarkus that referenced this issue Nov 15, 2022
Due to a bug in GraalVM, let's default to using Mandrel containers for
now.

See:
- quarkusio#29124
- oracle/graal#5303

(cherry picked from commit 4583de3)
@zakkak
Copy link
Collaborator

zakkak commented Nov 16, 2022

Should we create a user for the uid we are using in the container?

You would need to do this each time the container is created, since the uid we use is the one of the user starting the container, so it's not fixed. BTW Quarkus builder images ship with a quarkus user with uid 1001 which might be another reason some people (who happen to have users with uid 1001) don't observe the failure.

@jerboaa
Copy link
Collaborator

jerboaa commented Nov 25, 2022

45bf93a is the fix in the 22.3 tree. This should be fixed once 22.3.1 is released.

gsmet added a commit to gsmet/quarkus that referenced this issue Dec 14, 2022
Due to a bug in GraalVM, let's default to using Mandrel containers for
now.

See:
- quarkusio#29124
- oracle/graal#5303

(cherry picked from commit 4583de3)
snazy added a commit to snazy/nessie that referenced this issue Jan 19, 2023
snazy added a commit to snazy/nessie that referenced this issue Jan 19, 2023
snazy added a commit to projectnessie/nessie that referenced this issue Jan 19, 2023
@essobedo
Copy link

essobedo commented Feb 4, 2023

Since GraalVM 22.3.1 CE has been released and according to my test, the use case of the OP against this release works properly (as you can see below), maybe this issue can now be considered fixed, anything else to test/do?

% bb hl:compile && bb hl:native:executable
[holy-lambda] Command <hl:compile>
[holy-lambda] Nothing to compile. Sources did not change!
[holy-lambda] Command <hl:native:executable>
WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64) and no specific platform was requested
Apply jar:file:///project/.holy-lambda/build/output.jar!/META-INF/native-image/metosin/jsonista/native-image.properties
Apply jar:file:///project/.holy-lambda/build/output.jar!/META-INF/native-image/io/github/FieryCod/holy-lambda/native-image.properties
Warning: Ignoring server-mode native-image argument --no-server.
Apply jar:file:///opt/graalvm-ce-java17-22.3.1/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/thirdparty/native-image.properties
Apply jar:file:///opt/graalvm-ce-java17-22.3.1/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/polyglot/native-image.properties
Executing [
/opt/graalvm-ce-java17-22.3.1/bin/java \
-XX:+UseParallelGC \
-XX:+UnlockExperimentalVMOptions \
-XX:+EnableJVMCI \
-Dtruffle.TrustAllTruffleRuntimeProviders=true \
-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime \
-Dgraalvm.ForcePolyglotInvalid=true \
-Dgraalvm.locatorDisabled=true \
-Dsubstratevm.IgnoreGraalVersionCheck=true \
--add-exports=java.base/com.sun.crypto.provider=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.access.foreign=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.event=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.loader=org.graalvm.nativeimage.builder,org.graalvm.truffle \
--add-exports=java.base/jdk.internal.logger=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.misc=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile,org.graalvm.nativeimage.pointsto \
--add-exports=java.base/jdk.internal.module=jdk.internal.vm.compiler,org.graalvm.nativeimage.base,org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.org.objectweb.asm=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.perf=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.platform=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.ref=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=java.base/jdk.internal.reflect=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.util=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.vm.annotation=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.invoke.util=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.net=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.nio.ch=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=java.base/sun.reflect.annotation=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.factory=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.reflectiveObjects=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.repository=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.scope=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.tree=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.jca=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.provider=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.ssl=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.util=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.x509=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.text.spi=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.calendar=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.cldr=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.locale.provider=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.locale=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.resources=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util=org.graalvm.nativeimage.builder \
--add-exports=java.desktop/sun.java2d.pipe=org.graalvm.nativeimage.builder \
--add-exports=java.desktop/sun.java2d=org.graalvm.nativeimage.builder \
--add-exports=java.management/com.sun.jmx.mbeanserver=org.graalvm.nativeimage.builder \
--add-exports=java.management/sun.management=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.pointsto \
--add-exports=java.xml.crypto/org.jcp.xml.dsig.internal.dom=org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.site=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.stack=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile,org.graalvm.nativeimage.pointsto \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.common=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.pointsto \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=jdk.internal.vm.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=jdk.internal.vm.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.riscv64=jdk.internal.vm.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.meta=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile,org.graalvm.nativeimage.pointsto \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.riscv64=jdk.internal.vm.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.runtime=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.pointsto \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.services=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.events=org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.internal.handlers=org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.internal.jfc=org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.internal=org.graalvm.nativeimage.builder \
--add-exports=jdk.management/com.sun.management.internal=org.graalvm.nativeimage.builder \
-XX:+UseJVMCINativeLibrary \
-Xss10m \
-Xms1g \
-Xmx14g \
-Djava.awt.headless=true \
-Dorg.graalvm.version=22.3.1 \
-Dcom.oracle.graalvm.isaot=true \
-Djava.system.class.loader=com.oracle.svm.hosted.NativeImageSystemClassLoader \
-Xshare:off \
-Djdk.internal.lambda.disableEagerInitialization=true \
-Djdk.internal.lambda.eagerlyInitialize=false \
-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false \
--add-modules=ALL-DEFAULT \
--module-path \
/opt/graalvm-ce-java17-22.3.1/lib/truffle/truffle-api.jar:/opt/graalvm-ce-java17-22.3.1/lib/svm/builder/svm.jar:/opt/graalvm-ce-java17-22.3.1/lib/svm/builder/objectfile.jar:/opt/graalvm-ce-java17-22.3.1/lib/svm/builder/pointsto.jar:/opt/graalvm-ce-java17-22.3.1/lib/svm/builder/native-image-base.jar \
--module \
org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner \
-watchpid \
8 \
-imagecp \
/project/.holy-lambda/build/output.jar \
-imagemp \
/opt/graalvm-ce-java17-22.3.1/lib/svm/library-support.jar \
-H:CLibraryPath=/opt/graalvm-ce-java17-22.3.1/lib/svm/clibraries/linux-aarch64 \
-H:Path=/project/.holy-lambda/build \
'-H:Class@manifest from file:///project/.holy-lambda/build/output.jar=build_test.core' \
'-H:Name@manifest from file:///project/.holy-lambda/build/output.jar=output' \
'-H:ClassInitialization@jar:file:///project/.holy-lambda/build/output.jar!/META-INF/native-image/metosin/jsonista/native-image.properties=com.fasterxml.jackson:build_time' \
'-H:ClassInitialization@jar:file:///project/.holy-lambda/build/output.jar!/META-INF/native-image/metosin/jsonista/native-image.properties=jsonista:build_time' \
'-H:EnableURLProtocols@jar:file:///project/.holy-lambda/build/output.jar!/META-INF/native-image/io/github/FieryCod/holy-lambda/native-image.properties=http' \
'-H:ClassInitialization@jar:file:///project/.holy-lambda/build/output.jar!/META-INF/native-image/io/github/FieryCod/holy-lambda/native-image.properties=clojure:build_time,fierycod.holy_lambda:build_time,jsonista:build_time' \
-H:ConfigurationFileDirectories=native-configuration \
-H:FallbackThreshold=0 \
-H:+ReportUnsupportedElementsAtRuntime \
-H:+AllowIncompleteClasspath \
-H:EnableMonitoringFeatures=heapdump \
'-H:Features@jar:file:///opt/graalvm-ce-java17-22.3.1/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/thirdparty/native-image.properties=com.oracle.svm.thirdparty.gson.GsonFeature' \
'-H:Features@jar:file:///opt/graalvm-ce-java17-22.3.1/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/polyglot/native-image.properties=com.oracle.svm.polyglot.groovy.GroovyIndyInterfaceFeature,com.oracle.svm.polyglot.scala.ScalaFeature'
]
========================================================================================================================
GraalVM Native Image: Generating 'output' (executable)...
========================================================================================================================
Warning: Feature class InitAtBuildTimeFeature is annotated with the deprecated annotation @AutomaticFeature. Support for this annotation will be removed in a future version of GraalVM. Applications should register a feature using the option --features=InitAtBuildTimeFeature
[clj-easy/graal-build-time] Registering packages for build time initialization: clojure, build_test, clj_easy, fierycod.holy_lambda, jsonista
[1/7] Initializing...                                                                                  (112.4s @ 0.23GB)
 Version info: 'GraalVM 22.3.1 Java 17 CE'
 Java version info: '17.0.6+10-jvmci-22.3-b13'
 C compiler: gcc (redhat, aarch64, 7.3.1)
 Garbage collector: Serial GC
 1 user-specific feature(s)
 - InitAtBuildTimeFeature
[2/7] Performing analysis...  [*******]                                                                (706.8s @ 0.69GB)
   5,851 (83.72%) of  6,989 classes reachable
   7,300 (55.55%) of 13,141 fields reachable
  28,428 (51.88%) of 54,797 methods reachable
     204 classes,    98 fields, and   765 methods registered for reflection
      61 classes,    61 fields, and    55 methods registered for JNI access
       4 native libraries: dl, pthread, rt, z
[3/7] Building universe...                                                                              (52.3s @ 0.89GB)
[4/7] Parsing methods...      [******]                                                                  (44.2s @ 0.81GB)
[5/7] Inlining methods...     [***]                                                                     (28.8s @ 0.88GB)
[6/7] Compiling methods...    [**********************]                                                 (506.1s @ 0.66GB)
[7/7] Creating image...                                                                                 (43.5s @ 0.87GB)
  10.52MB (44.26%) for code area:    17,931 compilation units
  12.96MB (54.57%) for image heap:  163,561 objects and 9 resources
 285.34KB ( 1.17%) for other data
  23.76MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 packages in code area:                               Top 10 object types in image heap:
 863.38KB java.util                                            2.25MB byte[] for code metadata
 555.44KB clojure.lang                                         1.55MB java.lang.Class
 495.49KB java.lang.invoke                                     1.49MB java.lang.String
 418.43KB com.sun.crypto.provider                              1.46MB byte[] for general heap data
 411.71KB java.lang                                            1.05MB byte[] for java.lang.String
 351.73KB com.fasterxml.jackson.databind.deser.std           569.91KB java.util.HashMap$Node
 324.62KB java.text                                          502.82KB com.oracle.svm.core.hub.DynamicHubCompanion
 271.87KB java.util.concurrent                               288.02KB java.lang.String[]
 253.46KB java.util.regex                                    284.86KB java.util.concurrent.ConcurrentHashMap$Node
 237.31KB com.fasterxml.jackson.databind.deser               281.34KB java.util.HashMap$Node[]
   6.33MB for 208 more packages                                2.54MB for 1689 more object types
------------------------------------------------------------------------------------------------------------------------
                        17.3s (1.1% of total time) in 85 GCs | Peak RSS: 1.88GB | CPU load: 4.17
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /project/.holy-lambda/build/output (executable)
 /project/.holy-lambda/build/output.build_artifacts.txt (txt)
========================================================================================================================
Finished generating 'output' in 25m 35s.
[holy-lambda] Copying :backend:native-deps
[holy-lambda] Bundling artifacts...
  adding: bootstrap (stored 0%)
  adding: resources/ (stored 0%)
  adding: output (deflated 68%)
[holy-lambda] Native artifact of the project is available at .holy-lambda/build/latest.zip
[holy-lambda] Binary: .holy-lambda/build/output
[holy-lambda] Bootstrap: .holy-lambda/build/bootstrap

@jerboaa
Copy link
Collaborator

jerboaa commented Feb 6, 2023

Closing as fixed.

@jerboaa jerboaa closed this as completed Feb 6, 2023
snazy added a commit to snazy/nessie that referenced this issue Feb 7, 2023
This change effectively reverts projectnessie#5903 (projectnessie#5900), since oracle/graal#5303 is marked resolved for GraalVM 22.3.1, which is not also used for our native image builds via `quay.io/quarkus/[email protected]` pointing to `22.3.1`.
snazy added a commit to projectnessie/nessie that referenced this issue Feb 7, 2023
This change effectively reverts #5903 (#5900), since
oracle/graal#5303 is marked resolved for
GraalVM 22.3.1, which is not also used for our native image builds via
`quay.io/quarkus/[email protected]` pointing to
`22.3.1`.
@rubin55
Copy link

rubin55 commented Feb 22, 2023

FWIW, I'm still seeing this issue with 22.3.1, whilst building a docker image which downloads graalvm and then follows that up by running gu install native-image:

 > [stage-0  6/11] RUN gu install native-image:
#0 0.483 Exception in thread "main" java.lang.InternalError: java.lang.reflect.InvocationTargetException
#0 0.483 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.Metrics.systemMetrics(Metrics.java:67)
#0 0.483 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.Container.metrics(Container.java:44)
#0 0.483 Fatal error: Failed while initializing the performance data.: java.lang.InternalError: java.lang.reflect.InvocationTargetException
#0 0.483     at com.oracle.svm.core.containers.Metrics	at org.graalvm.nativeimage.builder/com.oracle.svm.core.ContainerInfo.<init>(ContainerInfo.java:34)
#0 0.483 .systemMetrics(Metrics.java:67	at org.graalvm.nativeimage.builder/com.oracle.svm.core.Containers.memoryLimitInBytes(Containers.java:177)
#0 0.483 )
#0 0.483     at com.oracle.svm.core.containers.Container.	at org.graalvm.nativeimage.builder/com.oracle.svm.core.heap.PhysicalMemory.doInitialize(PhysicalMemory.java:145)
#0 0.483 metrics(	at org.graalvm.nativeimage.builder/com.oracle.svm.core.heap.PhysicalMemory.size(PhysicalMemory.java:88)
#0 0.483 Container.java:44)
#0 0.483     at 	at [email protected]/java.lang.Runtime.maxMemory(Runtime.java:896)
#0 0.483 com.oracle.svm.core.ContainerInfo.<init>(	at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.DirectMemoryAccessors.initialize(Target_jdk_internal_misc_VM.java:120)
#0 0.483 ContainerInfo.java:34)	at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.DirectMemoryAccessors.getPageAlignDirectMemory(Target_jdk_internal_misc_VM.java:102)
#0 0.483 
#0 0.483     at com.oracle.svm.core.Containers	at [email protected]/jdk.internal.misc.VM.isDirectMemoryPageAligned(VM.java:147)
#0 0.483 .activeProcessorCount(	at [email protected]/java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:118)
#0 0.483 Containers.java:125	at [email protected]/java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:332)
#0 0.483 )	at [email protected]/sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:243)
#0 0.483 
#0 0.483     at 	at [email protected]/sun.nio.ch.IOUtil.read(IOUtil.java:293)
#0 0.483 java.lang.Runtime.	at [email protected]/sun.nio.ch.IOUtil.read(IOUtil.java:273)
#0 0.483 availableProcessors(Runtime.java:	at [email protected]/sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:232)
#0 0.483 	at [email protected]/sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65)
#0 0.483 	at [email protected]/sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:107)
#0 0.483 	at [email protected]/sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:101)
#0 0.483 	at [email protected]/java.io.InputStream.read(InputStream.java:218)
#0 0.483 	at [email protected]/java.util.Properties$LineReader.readLine(Properties.java:503)
#0 0.483 	at [email protected]/java.util.Properties.load0(Properties.java:419)
#0 0.483 	at [email protected]/java.util.Properties.load(Properties.java:408)
#0 0.483 	at org.graalvm.component.installer.persist.DirectoryStorage.load(DirectoryStorage.java:208)
#0 0.483 	at org.graalvm.component.installer.persist.DirectoryStorage.loadGraalVersionInfo(DirectoryStorage.java:193)
#0 0.483 	at org.graalvm.component.installer.model.ComponentRegistry.getGraalCapabilities(ComponentRegistry.java:179)
#0 0.483 	at org.graalvm.component.installer.ComponentInstaller.getReleaseCatalogURL(ComponentInstaller.java:625)
#0 0.483 	at org.graalvm.component.installer.ComponentInstaller.processOptions(ComponentInstaller.java:388)
#0 0.483 247	at org.graalvm.component.installer.ComponentInstaller.processCommand(ComponentInstaller.java:453)
#0 0.483 )
#0 0.483 	at org.graalvm.component.installer.ComponentInstaller.run(ComponentInstaller.java:580)
#0 0.483     at 	at org.graalvm.component.installer.ComponentInstaller.main(ComponentInstaller.java:633)
#0 0.483 com.oracle.svm.core.jvmstat.SystemCounters.getAvailableProcessorsCaused by: java.lang.reflect.InvocationTargetException
#0 0.483 (SystemCounters.java:177	at [email protected]/java.lang.reflect.Method.invoke(Method.java:568)
#0 0.483 )
#0 0.483     at 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.Metrics.systemMetrics(Metrics.java:63)
#0 0.483 com.oracle.svm.core.jvmstat.SystemCounters	... 30 more
#0 0.483 .allocateCaused by: java.lang.ExceptionInInitializerError
#0 0.483 (SystemCounters.java:124)
#0 0.483     at com.oracle.svm.core.jvmstat.PerfManager.allocate(	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupSubsystemFactory.create(CgroupSubsystemFactory.java:78)
#0 0.483 PerfManager.java:138)	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupMetrics.getInstance(CgroupMetrics.java:164)
#0 0.483 
#0 0.483 	... 32 more
#0 0.483     at com.oracle.svm.core.jvmstat.PerfManager$PerfDataThreadCaused by: java.lang.NullPointerException
#0 0.483 	at [email protected]/java.util.Objects.requireNonNull(Objects.java:208)
#0 0.483 	at [email protected]/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:263)
#0 0.483 	at [email protected]/java.nio.file.Path.of(Path.java:147)
#0 0.483 	at [email protected]/java.nio.file.Paths.get(Paths.java:69)
#0 0.483 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupUtil.lambda$readStringValue$0(CgroupUtil.java:57)
#0 0.483 	at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:144)
#0 0.483 	at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:569)
#0 0.483 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupUtil.readStringValue(CgroupUtil.java:59)
#0 0.483 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupSubsystemController.getStringValue(CgroupSubsystemController.java:66)
#0 0.483 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupSubsystemController.getLongValue(CgroupSubsystemController.java:125)
#0 0.483 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.cgroupv1.CgroupV1Subsystem.getLongValue(CgroupV1Subsystem.java:269)
#0 0.483 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.cgroupv1.CgroupV1Subsystem.getHierarchical(CgroupV1Subsystem.java:215)
#0 0.483 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.cgroupv1.CgroupV1Subsystem.setSubSystemControllerPath(CgroupV1Subsystem.java:203)
#0 0.483 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.cgroupv1.CgroupV1Subsystem.initSubSystem(CgroupV1Subsystem.java:111)
#0 0.483 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.cgroupv1.CgroupV1Subsystem.<clinit>(CgroupV1Subsystem.java:47)
#0 0.483 	... 34 more
#0 0.483 .initializeMemory(PerfManager.java:212)
#0 0.483     at com.oracle.svm.core.jvmstat.PerfManager$PerfDataThread.run(PerfManager.java:187)
#0 0.483     at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
#0 0.483     at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
#0 0.484 
#0 0.484 Current timestamp: 1677074902154
#0 0.484 
#0 0.484 Printing Instructions (ip=0x0000000000

@jerboaa
Copy link
Collaborator

jerboaa commented Feb 23, 2023

@rubin55 That's unrelated to this particular issue, sorry.

Your issue is likely caused by a bug in the container detection code in substrate. Likely the graal equivalent of https://bugs.openjdk.org/browse/JDK-8272124

@pompiuses
Copy link

@rubin55 did you find a solution to the problem? I've got similar problem reported here.

@rubin55
Copy link

rubin55 commented Aug 14, 2023

@pompiuses no, I never delved deeper and couldn't resolve at the time, sorry!

robobario added a commit to robobario/kafka-native that referenced this issue Aug 24, 2023
Why:
The build failed for me during at quarkus-maven-plugin:2.16.5.Final:build (default) @ kafka-server
with Fatal error: Failed while initializing the performance data.

Which appears to be a known issue with 22.3.0 oracle/graal#5303

Fixed for me by upgrading to the latest image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests