Skip to content

ClassTooLargeException in JacocoProcessor during instrumentation #49238

@dagrammy

Description

@dagrammy

Describe the bug

Hello everyone,

I'm not sure if this problem belongs here or https://github.com/quarkiverse/quarkus-amazon-services.

We have updated our project to Quarkus 3.25. There is a problem with Jacoco and the AWS services, more precisely the DefaultSsmAsyncClient.

During instrumentation there is a ClassTooLargeException concerning DefaultSsmAsyncClient in the quarkus JacocoProcessor

Stack trace (complete stack trace s. readme of reproducer repo)

Caused by: java.lang.RuntimeException: java.io.IOException: Error while instrumenting software.amazon.awssdk.services.ssm.DefaultSsmAsyncClient with JaCoCo 0.8.13.202504020838/78d5eff.
	at io.quarkus.jacoco.deployment.JacocoProcessor$1.apply(JacocoProcessor.java:93)
	at io.quarkus.jacoco.deployment.JacocoProcessor$1.apply(JacocoProcessor.java:83)
	at io.quarkus.deployment.steps.ClassTransformingBuildStep.transformClass(ClassTransformingBuildStep.java:350)
	at io.quarkus.deployment.steps.ClassTransformingBuildStep$2.call(ClassTransformingBuildStep.java:238)
	at io.quarkus.deployment.steps.ClassTransformingBuildStep$2.call(ClassTransformingBuildStep.java:225)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	... 7 more
Caused by: java.io.IOException: Error while instrumenting software.amazon.awssdk.services.ssm.DefaultSsmAsyncClient with JaCoCo 0.8.13.202504020838/78d5eff.
	at org.jacoco.core.instr.Instrumenter.instrumentError(Instrumenter.java:161)
	at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:111)
	at io.quarkus.jacoco.deployment.JacocoProcessor$1.apply(JacocoProcessor.java:87)
	... 12 more
Caused by: org.objectweb.asm.ClassTooLargeException: Class too large: software/amazon/awssdk/services/ssm/DefaultSsmAsyncClient
	at org.objectweb.asm.ClassWriter.toByteArray(ClassWriter.java:616)
	at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:92)
	at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:109)
	... 13 more

I also tried to add the class to quarkus.jacoco.excludes, but this config property seems only to exclude classes from the report.

Expected behavior

The build is successful and Jacoco report generated.

Actual behavior

The build fails.

How to Reproduce?

Clone https://github.com/dagrammy/jacoco-ssm-reproducer and run ./gradlew build.

Output of uname -a or ver

Darwin 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:54 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6030 arm64

Output of java -version

OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30)

Quarkus version or git rev

3.25.0

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

Gradle 8.14

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug-thirdpartyBugs that are caused by third-party components and not causing a major dysfunction of core Quarkus.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions