-
Bug
-
Resolution: Fixed
-
P3
-
21, 22
-
Linux yrodiere-gen4-redhat 6.6.2-101.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 22 21:31:13 UTC 2023 x86_64 GNU/Linux
openjdk version "22-ea" 2024-03-19
OpenJDK Runtime Environment (build 22-ea+26-2112)
OpenJDK 64-Bit Server VM (build 22-ea+26-2112, mixed mode, sharing)Also reproducible with OpenJDK 22-ea+25, 22-ea+24
Earlier OpenJDK 22-ea versions apparently aren't affected: we didn't notice the bug until ea+24, but that could just be that our code changed in a way that triggers the bug around the time ea+24 was published.
Not reproducible with OpenJDK 21
Linux yrodiere-gen4-redhat 6.6.2-101.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 22 21:31:13 UTC 2023 x86_64 GNU/Linux openjdk version "22-ea" 2024-03-19 OpenJDK Runtime Environment (build 22-ea+26-2112) OpenJDK 64-Bit Server VM (build 22-ea+26-2112, mixed mode, sharing) Also reproducible with OpenJDK 22-ea+25, 22-ea+24 Earlier OpenJDK 22-ea versions apparently aren't affected: we didn't notice the bug until ea+24, but that could just be that our code changed in a way that triggers the bug around the time ea+24 was published. Not reproducible with OpenJDK 21
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8323772 | 21.0.3-oracle | Jan Lahoda | P3 | Resolved | Fixed | b02 |
JDK-8323816 | 21.0.3 | Aleksey Shipilev | P3 | Resolved | Fixed | b01 |
```
Caused by: java.lang.AssertionError: Filling jrt:/java.compiler/javax/lang/model/type/TypeMirror.class during JarFileObject[/home/yrodiere/workspaces/testcases/jdk-playground/processor/target/jdk-playground-processor-1.0-SNAPSHOT.jar:/org/hibernate/jpamodelgen/util/TypeUtils$2.class]
at com.sun.tools.javac.util.Assert.error (Assert.java:162)
at com.sun.tools.javac.code.ClassFinder.fillIn (ClassFinder.java:366)
at com.sun.tools.javac.code.ClassFinder.complete (ClassFinder.java:302)
at com.sun.tools.javac.code.Symbol.complete (Symbol.java:682)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete (Symbol.java:1418)
at com.sun.tools.javac.code.Symbol.apiComplete (Symbol.java:688)
at com.sun.tools.javac.code.Type$ClassType.getKind (Type.java:1208)
at com.sun.tools.javac.code.Types$14.combineMetadata (Types.java:2413)
at com.sun.tools.javac.code.Types$14.visitClassType (Types.java:2453)
at com.sun.tools.javac.code.Types$14.visitClassType (Types.java:2409)
at com.sun.tools.javac.code.Type$ClassType.accept (Type.java:1050)
at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit (Types.java:4903)
at com.sun.tools.javac.code.Types.erasure (Types.java:2404)
at com.sun.tools.javac.code.Types.erasure (Types.java:2390)
at com.sun.tools.javac.jvm.ClassReader.isSameBinaryType (ClassReader.java:1403)
at com.sun.tools.javac.jvm.ClassReader.findMethod (ClassReader.java:1376)
at com.sun.tools.javac.jvm.ClassReader.readEnclosingMethodAttr (ClassReader.java:1323)
at com.sun.tools.javac.jvm.ClassReader$10.read (ClassReader.java:999)
at com.sun.tools.javac.jvm.ClassReader.readAttrs (ClassReader.java:1435)
at com.sun.tools.javac.jvm.ClassReader.readClassAttrs (ClassReader.java:1449)
at com.sun.tools.javac.jvm.ClassReader.readClass (ClassReader.java:2931)
at com.sun.tools.javac.jvm.ClassReader.readClassBuffer (ClassReader.java:3049)
at com.sun.tools.javac.jvm.ClassReader.readClassFile (ClassReader.java:3073)
at com.sun.tools.javac.code.ClassFinder.fillIn (ClassFinder.java:373)
at com.sun.tools.javac.code.ClassFinder.complete (ClassFinder.java:302)
at com.sun.tools.javac.code.Symbol.complete (Symbol.java:682)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete (Symbol.java:1418)
at com.sun.tools.javac.code.Symbol.apiComplete (Symbol.java:688)
at com.sun.tools.javac.code.Symbol$TypeSymbol.getEnclosedElements (Symbol.java:859)
at com.sun.tools.javac.code.Symbol$TypeSymbol.getEnclosedElements (Symbol.java:797)
at org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor.process (JPAMetaModelEntityProcessor.java:36)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor (JavacProcessingEnvironment.java:1021)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.runContributingProcs (JavacProcessingEnvironment.java:857)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1263)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1402)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1276)
at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:946)
at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:104)
at com.sun.tools.javac.api.JavacTaskImpl.invocationHelper (JavacTaskImpl.java:152)
at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:100)
at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:94)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:126)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1134)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:187)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:52)
at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:161)
at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:73)
```
We've been experiencing this on Hibernate ORM while testing against JDK 22-ea+24 and later (ea+25 and ea+26 also affected); see the currently failing CI build at https://ci.hibernate.org/job/hibernate-orm-pipeline/job/main/
Since Hibernate ORM is a relatively large codebase and not very convenient for this sort of debugging, I came up with a minimal reproducer: see https://github.com/yrodiere/jdk-playground/tree/assertion-error-annotation-processor-jdk-22 and its readme.
Reproducing this problem seems to require a rather specific setup. The reproducer is still a bit complex but that's the best I could do; I wasn't able to remove/change anything more without eliminating the problem.
To run the reproducer (requires OpenJDK 21+, fails only on OpenJDK 22):
```
git clone https://github.com/yrodiere/jdk-playground.git
git switch assertion-error-annotation-processor-jdk-22
./mvnw clean install -e
```
The reproducer relies on Maven and compiles with `javax.tools`, which has the advantage of producing a detailed stacktrace. Compilations fails when using `javac` too (`-Dmaven.compiler.forceJavacCompilerUse=true`), but then you won't get any details about the failure.
See https://ci.hibernate.org/blue/organizations/jenkins/jdk-playground-personal-yoann/activity?branch=assertion-error-annotation-processor-jdk-22 for executions of the reproducer on our CI, with logs, for both OpenJDK 21 (passing) and OpenJDK 22 (failing).
- backported by
-
JDK-8323772 javac with annotation processor throws AssertionError: Filling jrt:/... during JarFileObject[/...]
- Resolved
-
JDK-8323816 javac with annotation processor throws AssertionError: Filling jrt:/... during JarFileObject[/...]
- Resolved
- links to
-
Commit openjdk/jdk21u-dev/f57f2cba
-
Commit openjdk/jdk/03c45951
-
Review openjdk/jdk21u-dev/146
-
Review openjdk/jdk/17001