question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Native build always get stuck at 'parsing method'

See original GitHub issue

Describe the bug

I using quarkus 8.3.Final , gradle Native build always get stucked at the step [4/7] Parsing methods... [******] while grinding the CPU

Building native image source jar: /home/runner/work/qu-queue-service/qu-queue-service/build/qu-queue-service-1.0.0-SNAPSHOT-native-image-source-jar/qu-queue-service-1.0.0-SNAPSHOT-runner.jar
Building native image from /home/runner/work/qu-queue-service/qu-queue-service/build/qu-queue-service-1.0.0-SNAPSHOT-native-image-source-jar/qu-queue-service-1.0.0-SNAPSHOT-runner.jar
Using docker to run the native image builder
Checking image status quay.io/quarkus/ubi-quarkus-mandrel:22.0.0.2-Final-java17
22.0.0.2-Final-java17: Pulling from quarkus/ubi-quarkus-mandrel
54e56e6f8572: Pulling fs layer
4f8ddd7f5a75: Pulling fs layer
20939a5b3d59: Pulling fs layer
4f8ddd7f5a75: Verifying Checksum
4f8ddd7f5a75: Download complete
54e56e6f8572: Verifying Checksum
54e56e6f8572: Download complete
54e56e6f8572: Pull complete
20939a5b3d59: Verifying Checksum
20939a5b3d59: Download complete
4f8ddd7f5a75: Pull complete
20939a5b3d59: Pull complete
Digest: sha256:7751b408ac408d6f91a95c864a2b8d85129987c8d5c1fc5356e9940c8e330837
Status: Downloaded newer image for quay.io/quarkus/ubi-quarkus-mandrel:22.0.0.2-Final-java17
quay.io/quarkus/ubi-quarkus-mandrel:22.0.0.2-Final-java17
Running Quarkus native-image plugin on native-image 22.0.0.2-Final Mandrel Distribution (Java Version 17.0.2+8)
docker run --env LANG=C --rm --user 1001:121 -v /home/runner/work/qu-queue-service/qu-queue-service/build/qu-queue-service-1.0.0-SNAPSHOT-native-image-source-jar:/project:z --name build-native-clyaI quay.io/quarkus/ubi-quarkus-mandrel:22.0.0.2-Final-java17 -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Dfile.encoding=UTF-8 -H:-ParseOnce -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -J-Djava.awt.headless=true -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -J-Xmx3G -H:-AddAllCharsets -H:EnableURLProtocols=http,https -H:-UseServiceLoaderFeature -H:+StackTrace qu-queue-service-1.0.0-SNAPSHOT-runner -jar qu-queue-service-1.0.0-SNAPSHOT-runner.jar
========================================================================================================================
GraalVM Native Image: Generating 'qu-queue-service-1.0.0-SNAPSHOT-runner'...
========================================================================================================================
[1/7] Initializing...                                                                                   (13.1s @ 0.22GB)
Version info: 'GraalVM 22.0.0.2-Final Java 17 Mandrel Distribution'
8 user-provided feature(s)
 - io.quarkus.caffeine.runtime.graal.CacheConstructorsAutofeature
 - io.quarkus.hibernate.orm.runtime.graal.DisableLoggingAutoFeature
 - io.quarkus.jdbc.postgresql.runtime.graal.SQLXMLFeature
 - io.quarkus.runner.AutoFeature
 - io.quarkus.runtime.graal.DisableLoggingAutoFeature
 - io.quarkus.runtime.graal.ResourcesFeature
 - org.hibernate.graalvm.internal.GraalVMStaticAutofeature
 - org.hibernate.graalvm.internal.QueryParsingSupport
[2/7] Performing analysis...  [**********]                                                             (191.2s @ 2.47GB)
 26,471 (96.76%) of 27,356 classes reachable
 45,531 (68.17%) of 66,791 fields reachable
143,995 (80.30%) of 179,318 methods reachable
  1,537 classes, 1,795 fields, and 10,535 methods registered for reflection
     65 classes,    77 fields, and    55 methods registered for JNI access
[3/7] Building universe...                                                                               (7.2s @ 2.60GB)
[4/7] Parsing methods...      [******]       

Expected behavior

Native build should be completed, or a clarification error should be shown

Actual behavior

The native build get stuck at the the step, for as long as 6h

How to Reproduce?

No response

Output of uname -a or ver

Linux ahmed-legion 5.16.20-2-MANJARO #1 SMP PREEMPT Thu Apr 14 06:44:39 UTC 2022 x86_64 GNU/Linux

Output of java -version

openjdk version “17.0.2” 2022-01-18 OpenJDK Runtime Environment Temurin-17.0.2+8 (build 17.0.2+8) OpenJDK 64-Bit Server VM Temurin-17.0.2+8 (build 17.0.2+8, mixed mode, sharing)

GraalVM version (if different from Java)

using builder image quay.io/quarkus/ubi-quarkus-mandrel:22.0.0.2-Final-java17

Quarkus version or git rev

2.8.3.Final

Build tool (ie. output of mvnw --version or gradlew --version)

------------------------------------------------------------ Gradle 7.3-rc-5 ------------------------------------------------------------ Build time: 2021-11-05 18:43:37 UTC Revision: 426f267f7b768154fd63b27e055ba56b357e6e4e Kotlin: 1.5.31 Groovy: 3.0.9 Ant: Apache Ant™ version 1.10.11 compiled on July 10 2021 JVM: 17.0.2 (Eclipse Adoptium 17.0.2+8) OS: Linux 5.16.20-2-MANJARO amd64

Additional information

build.gradle.kts

plugins {
    java
    id("io.quarkus")
}

repositories {
    mavenLocal()
    mavenCentral()
}

val quarkusPlatformGroupId: String by project
val quarkusPlatformArtifactId: String by project
val quarkusPlatformVersion: String by project

dependencies {
    implementation("io.quarkus:quarkus-container-image-jib")
    implementation(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}"))
    implementation("io.quarkus:quarkus-resteasy-reactive-jackson")
    implementation("io.quarkus:quarkus-jaxrs-client-reactive")
    implementation("io.quarkus:quarkus-hibernate-reactive-panache")
    implementation("io.quarkus:quarkus-smallrye-openapi")
//    implementation("io.quarkus:quarkus-smallrye-jwt")
    implementation("io.quarkus:quarkus-liquibase")
    implementation("io.quarkus:quarkus-mailer")
    implementation("io.quarkus:quarkus-reactive-pg-client")
    implementation("io.quarkus:quarkus-smallrye-metrics")
    implementation("io.quarkus:quarkus-arc")
    implementation("io.quarkus:quarkus-oidc")
    implementation("org.hibernate.validator:hibernate-validator")
    implementation("io.quarkus:quarkus-jdbc-postgresql")
    implementation("io.quarkus:quarkus-keycloak-admin-client")
    implementation("io.quarkus:quarkus-cache")
    implementation("org.mapstruct:mapstruct:1.4.1.Final")


    compileOnly("org.projectlombok:lombok:1.18.16")
    compileOnly("javax.validation:validation-api:2.0.1.Final")
    testCompileOnly("org.projectlombok:lombok:1.18.20")
    annotationProcessor("org.projectlombok:lombok:1.18.20")
    testAnnotationProcessor("org.projectlombok:lombok:1.18.20")
    annotationProcessor("org.mapstruct:mapstruct-processor:1.4.1.Final")


    testImplementation("io.quarkus:quarkus-junit5")
    testImplementation("io.quarkus:quarkus-junit5-mockito")
    testImplementation("io.quarkus:quarkus-test-security-oidc")
    testImplementation("io.rest-assured:rest-assured")
    testImplementation("org.testcontainers:postgresql:1.15.1")
    testImplementation("org.jdbi:jdbi3-core:3.1.0")
    testImplementation("com.tngtech.keycloakmock:mock:0.6.0");
    testImplementation("io.quarkus:quarkus-test-oidc-server")
    testImplementation("uk.co.datumedge:hamcrest-json:0.2")
    testImplementation("org.skyscreamer:jsonassert:1.5.0")
}

group = "com.qu"
version = "1.0.0-SNAPSHOT"

java {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

tasks.withType<JavaCompile> {
    options.encoding = "UTF-8"
    options.compilerArgs.add("-parameters")
}



Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
galderzcommented, May 24, 2022

@geoand I’d wait a bit and give @deathwaiting opportunity to explain the need for constrained resources.

0reactions
Karmcommented, Nov 18, 2022

With these modifications to the original reproducer:

$ git diff
diff --git a/gradle.properties b/gradle.properties
index 9b25299..4ef6191 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,7 +1,7 @@
         #Gradle properties
 #Fri May 13 17:59:43 EET 2022
-quarkusPluginVersion=2.8.3.Final
+quarkusPluginVersion=2.13.4.Final
 quarkusPlatformArtifactId=quarkus-universe-bom
 quarkusPluginId=io.quarkus
 quarkusPlatformGroupId=io.quarkus
-quarkusPlatformVersion=2.8.3.Final
+quarkusPlatformVersion=2.13.4.Final
diff --git a/gradlew b/gradlew
old mode 100644
new mode 100755
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 68f7675..b08af3f 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -75,6 +75,6 @@ quarkus.swagger-ui.oauth-realm=qu
 quarkus.swagger-ui.oauth-app-name=backend-service
 
 #Image build
-quarkus.container-image.image=docker.io/ahmedgalalfathy/private:qu-backend
+#quarkus.container-image.image=docker.io/ahmedgalalfathy/private:qu-backend
 quarkus.container-image.push=false
-quarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:21.3.2.0-Final-java17
\ No newline at end of file
+quarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:22.3-java17

The build completes for me just fine, the memory consumption is nothing outlandish or unexpected:

$ ./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true -Dquarkus.native.container-runtime=docker -x test
Starting a Gradle Daemon (subsequent builds will be faster)
The Agroal dependency is present but no JDBC datasources have been defined.
22.3-java17: Pulling from quarkus/ubi-quarkus-mandrel
...
Digest: sha256:5f24fe7559dd5ed8f5765ea44de42395c7ae13f8ea48f75dd4ca3a67c3a91486
Status: Downloaded newer image for quay.io/quarkus/ubi-quarkus-mandrel:22.3-java17
quay.io/quarkus/ubi-quarkus-mandrel:22.3-java17
========================================================================================================================
GraalVM Native Image: Generating 'qu-queue-service-1.0.0-SNAPSHOT-runner' (executable)...
========================================================================================================================
[1/7] Initializing...                                                                                   (12.3s @ 0.41GB)
 Version info: 'GraalVM 22.3.0.1-Final Java 17 Mandrel Distribution'
 Java version info: '17.0.5+8'
 C compiler: gcc (redhat, x86_64, 8.5.0)
 Garbage collector: Serial GC
 9 user-specific feature(s)
 - io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature
 - io.quarkus.hibernate.orm.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase for the [org.hibernate.Version, org.hibernate.annotations.common.Version, org.hibernate.dialect.Dialect] categories
 - io.quarkus.jdbc.postgresql.runtime.graal.SQLXMLFeature
 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
 - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase for the [org.jboss.threads] categories
 - io.quarkus.runtime.graal.ResourcesFeature: Register each line in META-INF/quarkus-native-resources.txt as a resource on Substrate VM
 - org.graalvm.home.HomeFinderFeature: Finds GraalVM paths and its version number
 - org.hibernate.graalvm.internal.GraalVMStaticFeature: Hibernate ORM's static reflection registrations for GraalVM
 - org.hibernate.graalvm.internal.QueryParsingSupport: Hibernate ORM's support for HQL Parser in GraalVM
[2/7] Performing analysis...  [*******]                                                                 (73.8s @ 2.45GB)
  24,627 (92.11%) of 26,737 classes reachable
  41,336 (64.53%) of 64,054 fields reachable
 126,032 (58.37%) of 215,918 methods reachable
   1,376 classes, 1,634 fields, and 11,049 methods registered for reflection
      64 classes,    70 fields, and    55 methods registered for JNI access
       4 native libraries: dl, pthread, rt, z
[3/7] Building universe...                                                                              (15.3s @ 2.20GB)
[4/7] Parsing methods...      [***]                                                                      (9.2s @ 1.51GB)
[5/7] Inlining methods...     [***]                                                                      (4.0s @ 1.62GB)
[6/7] Compiling methods...    [*******]                                                                 (54.6s @ 2.09GB)
[7/7] Creating image...                                                                                  (8.8s @ 1.95GB)
  50.14MB (48.42%) for code area:    84,407 compilation units
  53.08MB (51.26%) for image heap:  552,567 objects and 326 resources
 344.74KB ( 0.33%) for other data
 103.56MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 packages in code area:                               Top 10 object types in image heap:
   2.68MB org.keycloak.admin.client.resource                  11.21MB byte[] for code metadata
   1.64MB sun.security.ssl                                     6.16MB byte[] for embedded resources
   1.60MB jdk.proxy4                                           6.01MB java.lang.Class
   1.10MB java.util                                            5.09MB java.lang.String
 771.50KB io.quarkus.runtime.generated                         4.71MB byte[] for java.lang.String
 729.31KB java.lang.invoke                                     4.13MB byte[] for general heap data
 718.47KB com.sun.crypto.provider                              2.07MB com.oracle.svm.core.hub.DynamicHubCompanion
 587.36KB org.hibernate.hql.internal.antlr                     1.70MB byte[] for reflection metadata
 552.63KB liquibase.sqlgenerator.core                          1.02MB java.lang.String[]
 537.21KB com.oracle.svm.core.code                           872.20KB java.util.HashMap$Node
  38.69MB for 1166 more packages                               9.84MB for 5340 more object types
------------------------------------------------------------------------------------------------------------------------
                       24.0s (12.4% of total time) in 256 GCs | Peak RSS: 3.93GB | CPU load: 7.98
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /project/qu-queue-service-1.0.0-SNAPSHOT-runner (executable)
 /project/qu-queue-service-1.0.0-SNAPSHOT-runner-build-output-stats.json (json)
 /project/qu-queue-service-1.0.0-SNAPSHOT-runner-timing-stats.json (raw)
 /project/qu-queue-service-1.0.0-SNAPSHOT-runner.build_artifacts.txt (txt)
========================================================================================================================
Finished generating 'qu-queue-service-1.0.0-SNAPSHOT-runner' in 3m 12s.

BUILD SUCCESSFUL in 15m 6s
6 actionable tasks: 3 executed, 3 up-to-date
Read more comments on GitHub >

github_iconTop Results From Across the Web

quarkus native build is stuck - java - Stack Overflow
I using quarkus 8.3.Final , gradle Native build always get stucked at. Building native image source jar: ...
Read more >
Question - IL2CPP stuck at "Building native binary with IL2CPP"
Hi all, I'm trying to build an Android game with IL2CPP (Debug), but it seems that it's hanging on "Building native binary with...
Read more >
Code parsing gets "Stuck"? – IDEs Support (IntelliJ Platform)
Basically, it will start saying some class class does not exist, but it exists on the source path (the last time this happened,...
Read more >
3 Common Tasks — The Yocto Project ® 4.1.999 documentation
During the build process, BitBake displays an error on starting if it detects a .bbappend file that does not have a corresponding recipe...
Read more >
Writing a Parser — Part III: Syntax Error Handling - Medium
A common issue that recursive-descent parser with error recovery faces is, getting stuck on infinite recursions. This can happen when the error handler...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found