showcase-quarkus-eventsourcing icon indicating copy to clipboard operation
showcase-quarkus-eventsourcing copied to clipboard

Update to quarkus version 3.2.0.CR1 breaks native image trace agent

Open JohT opened this issue 6 months ago • 0 comments

Reproduce native image agent trace corrupt json

After running mvn verify --activate-profiles native-image-agent-trace locally or in the pipeline as configured in pom.xml, the generated JSON is corrupt (not closed correctly) and the very last lines look e.g. like this:

{"caller_class":"java.lang.invoke.InnerClassLambdaMetafactory$1", "args":[], "function":"getDeclaredConstructors", "tracer":"reflect", "class":"io.smallrye.openapi.api.OpenApiConfig$$Lambda$1757/0x00000008014abf70"},
{"caller_class":"java.lang.invoke.InnerClassLambdaMetafactory", "result":"true", "args":[[]], "declaring_class":"io.smallrye.openapi.api.OpenApiConfig$$Lambda$1757/0x00000008014abf70", "function":"invokeConstructor", "tracer":"reflect", "class":"io.smallrye.openapi.api.OpenApiConfig$$Lambda$1757/0x00000008014abf70"},
{"caller_class":"java.lang.invoke.InnerClassLambdaMetafactory$1", "args":[], "function":"getDeclaredConstructors", "tracer":"reflect", "class":"io.smallrye.openapi.api.OpenApiConfig$$Lambda$1758/0x00000008014ac190"},
{"caller_class":"java.lang.invoke.InnerClassLambdaMetafactory", "result":"true", "args":[[]], "declaring_class":"io.smallrye.openapi.api.OpenApiConfig$$Lambda$1758/0x00000008014ac190", "function":"invokeConstructor", "tracer":"reflect", "class":"io.smallrye.openapi.api.OpenApiConfig$$L

Trying to process the corrupt JSON file locally with $GRAALVM_HOME/bin/native-image-configure generate --trace-input=target/native-image-agent-trace.json or in the pipeline leads to an error like this:

com.oracle.svm.core.util.json.JSONParserException: line 23493 column 286 Missing close quote
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.json.JSONParser.error(JSONParser.java:377)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.json.JSONParser.parseString(JSONParser.java:221)

I suspect that the JVM for testing is shutdown without waiting for files to be flushed or something like that. But that's just an idea. Don't know if this could be....

Everything is working fine with quarkus 3.1.3.Final. The change seems to had been introduced with 3.2.0.CR1: https://github.com/quarkusio/quarkus/compare/3.1.3.Final...3.2.0.CR1

References

JohT avatar Dec 17 '23 07:12 JohT