Skip to content

Conversation

@JohT
Copy link
Owner

@JohT JohT commented Dec 17, 2023

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:
quarkusio/quarkus@3.1.3.Final...3.2.0.CR1

References

@JohT JohT self-assigned this Dec 17, 2023
@JohT JohT changed the title Update to quarkus version 3.2.0.CR1 Update to quarkus version 3.2.0.CR1 breaks native image trace agent Dec 17, 2023
JohT added a commit that referenced this pull request Dec 18, 2023
JohT added a commit that referenced this pull request Dec 18, 2023
JohT added a commit that referenced this pull request Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants