-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Justinas Dabravolskas
committed
Dec 8, 2024
1 parent
faffe67
commit 8280291
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
# jit-broken-switch-example | ||
Original discussion in https://github.com/raphw/byte-buddy/issues/1732 | ||
|
||
ByteBuddy sporadically runs into an "impossible" exception in `net.bytebuddy.dynamic.scaffold.TypeWriter.Default.ValidatingClassVisitor.visitField`. | ||
This code path can happen just with switch statement skipping all branches including default. | ||
In general this condition is rare, but running `org.example.App with` `-Xcomp` reliably reproduces this condition on `Java 18-23`. | ||
|
||
|
||
`Exception in thread "main" java.lang.IllegalStateException: Field POOL_NORMAL defines an incompatible default value 0 | ||
at net.bytebuddy.dynamic.scaffold.TypeWriter$Default$ValidatingClassVisitor.visitField(TypeWriter.java:2535) | ||
at net.bytebuddy.dynamic.scaffold.TypeWriter$Default$ForInlining$WithFullProcessing$RedefinitionClassVisitor.onVisitField(TypeWriter.java:5164) | ||
at net.bytebuddy.utility.visitor.MetadataAwareClassVisitor.visitField(MetadataAwareClassVisitor.java:278) | ||
at net.bytebuddy.jar.asm.ClassVisitor.visitField(ClassVisitor.java:356) | ||
at net.bytebuddy.jar.asm.commons.ClassRemapper.visitField(ClassRemapper.java:169) | ||
at net.bytebuddy.jar.asm.ClassReader.readField(ClassReader.java:1138) | ||
at net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:740) | ||
at net.bytebuddy.utility.AsmClassReader$Default.accept(AsmClassReader.java:132) | ||
at net.bytebuddy.dynamic.scaffold.TypeWriter$Default$ForInlining.create(TypeWriter.java:4039) | ||
at net.bytebuddy.dynamic.scaffold.TypeWriter$Default.make(TypeWriter.java:2246) | ||
at net.bytebuddy.dynamic.DynamicType$Builder$AbstractBase$UsingTypeWriter.make(DynamicType.java:4085) | ||
at net.bytebuddy.dynamic.DynamicType$Builder$AbstractBase.make(DynamicType.java:3769) | ||
at org.example.App.main(App.java:20)` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* The settings file is used to specify which projects to include in your build. | ||
* For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.11.1/userguide/multi_project_builds.html in the Gradle documentation. | ||
*/ | ||
|
||
plugins { | ||
// Apply the foojay-resolver plugin to allow automatic download of JDKs | ||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' | ||
} | ||
|
||
rootProject.name = 'jit-broken-switch-example' | ||
include('app') |