Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Lombok crashes with OpenJ9 #2414

Closed
xxDark opened this issue Apr 5, 2020 · 6 comments
Closed

[BUG] Lombok crashes with OpenJ9 #2414

xxDark opened this issue Apr 5, 2020 · 6 comments

Comments

@xxDark
Copy link

xxDark commented Apr 5, 2020

Describe the bug
Lombok annotation processor crashes when trying to build a project with OpenJ9, version 13.

To Reproduce
Compile any project, and process will crash.

Expected behavior
Everything should work as expected

Version info (please complete the following information):

@xxDark xxDark changed the title [BUG] Lombok crashes on OpenJ9 [BUG] Lombok crashes with OpenJ9 Apr 5, 2020
@xxDark
Copy link
Author

xxDark commented Apr 5, 2020

lombok-mre.zip

@ghunteranderson
Copy link

I can reproduce consistently without Gradle. Command below:

"C:\Program Files\Java\jdk-13.0.2+8-openj9\bin\javac.exe" -cp lombok.jar lombok-mre\src\main\java\Test.java

It looks like a general protection fault in the OpenJ9 library j9jit29.dll. I'm little a fuzzy on this topic but if remember right that usually means that j9jit29.dll tried to access memory space it wasn't allowed to access. Windows raised a fault and the JVM couldn't recover.

This works ok when I compile with JDK 13.0.2 and without OpenJ9. I don't think there is anything the Lombok project can do to fix this. It looks like a bug in OpenJ9. I'm linking the OpenJ9 issue that is investigating this. As a workaround, I suspect you can compile without OpenJ9 and then use OpenJ9 for runtime.

eclipse-openj9/openj9#6933

fengxue-IS added a commit to fengxue-IS/lombok that referenced this issue Apr 22, 2020
Currently lombok crashes when building with OpenJ9 JDK as described in projectlombok#2414
It is due to the `override` field offset from Fake.class doesn't match actual offset value for AccessibleObject.class in OpenJ9 
This change is to support the OpenJ9 Field layout algorithm.
@DanHeidinga
Copy link

The issue is due to the different field layout algorithms in Hotspot vs OpenJ9 and can be fixed by making the "Fake" class have the same fields as AccessibleObject - see @fengxue-IS's PR #2437 - so that it works regardless of changes to the field layout algorithms.

rspilker pushed a commit that referenced this issue May 28, 2020
Currently lombok crashes when building with OpenJ9 JDK as described in #2414
It is due to the `override` field offset from Fake.class doesn't match actual offset value for AccessibleObject.class in OpenJ9 
This change is to support the OpenJ9 Field layout algorithm.
@rspilker
Copy link
Collaborator

Can someone confirm the fix in the edge release?

@fengxue-IS
Copy link
Contributor

fengxue-IS commented Jun 1, 2020

confirms edge release works on my local machine

root@holed1:~/tmp/gpf/edge$ mvn compile
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building app 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://projectlombok.org/edge-releases/org/projectlombok/lombok/edge-SNAPSHOT/maven-metadata.xml
Downloaded: https://projectlombok.org/edge-releases/org/projectlombok/lombok/edge-SNAPSHOT/maven-metadata.xml (2 KB at 1.0 KB/sec)
Downloading: https://projectlombok.org/edge-releases/org/projectlombok/lombok/edge-SNAPSHOT/lombok-edge-20200528.222155-1.pom
Downloaded: https://projectlombok.org/edge-releases/org/projectlombok/lombok/edge-SNAPSHOT/lombok-edge-20200528.222155-1.pom (2 KB at 25.5 KB/sec)
Downloading: https://projectlombok.org/edge-releases/org/projectlombok/lombok/edge-SNAPSHOT/lombok-edge-20200528.222155-1.jar
Downloaded: https://projectlombok.org/edge-releases/org/projectlombok/lombok/edge-SNAPSHOT/lombok-edge-20200528.222155-1.jar (1790 KB at 5157.7 KB/sec)
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ app ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /root/tmp/gpf/edge/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.846 s
[INFO] Finished at: 2020-06-01T10:59:02-07:00
[INFO] Final Memory: 26M/45M
[INFO] ------------------------------------------------------------------------

pom.xml

 16 <repositories>
 17     <repository>
 18         <id>projectlombok.org</id>
 19         <url>https://projectlombok.org/edge-releases</url>
 20     </repository>
 21 </repositories>
 22 
 23     <properties>
 24         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 25         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 26     </properties>
 27 
 28     <dependencies>
 29         <dependency>
 30             <groupId>org.springframework.boot</groupId>
 31             <artifactId>spring-boot-starter-web</artifactId>
 32         </dependency>
 33         <dependency>
 34             <groupId>org.projectlombok</groupId>
 35             <artifactId>lombok</artifactId>
 36             <version>edge-SNAPSHOT</version>
 37             <scope>provided</scope>
 38         </dependency>
 39     </dependencies>
 40 
 41     <build>
 42         <plugins>
 43             <!--
 44             <plugin>
 45                 <groupId>org.apache.maven.plugins</groupId>
 46                 <artifactId>maven-compiler-plugin</artifactId>
 47                 <configuration>
 48                     <compilerArgs>
 49                         <arg>-verbose</arg>
 50                         <arg>-Xlint:all,-options,-path</arg>
 51                         <arg>-Xshareclasses</arg>
 52                     </compilerArgs>
 53                     <fork>true</fork>
 54                     <executable>/root/tmp/gpf/jdk-13.0.2+8/bin/javac</executable>
 55                     <compilerVersion>13</compilerVersion>
 56                 </configuration>
 57             </plugin>
 58             -->
 59             <plugin>
 60                 <groupId>org.springframework.boot</groupId>
 61                 <artifactId>spring-boot-maven-plugin</artifactId>
 62             </plugin>
 63         </plugins>
 64     </build>

Java

root@holed1:~/tmp/gpf/edge$ /root/tmp/gpf/jdk-13.0.2+8/bin/java -version
openjdk version "13.0.2" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.2+8)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.18.0, JRE 13 Linux amd64-64-Bit Compressed References 20200117_151 (JIT enabled, AOT enabled)
OpenJ9   - 6968c18d7
OMR      - 7a1b0239a
JCL      - 9c5a41bd5f based on jdk-13.0.2+8)

@rspilker
Copy link
Collaborator

rspilker commented Jun 1, 2020

Thanks for the verification

@rspilker rspilker closed this as completed Jun 1, 2020
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

No branches or pull requests

5 participants