[GRADLE-3578] Daemon JVM crashes if Java compiler uses different Jansi version than bundled with Gradle Created: 02/Nov/16  Updated: 24/Jan/17  Resolved: 24/Jan/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Benjamin Muschko Assignee: Benjamin Muschko
Resolution: Duplicate Votes: 0

Known Issue Of:


Reported via GitHub issues: https://github.com/gradle/gradle/issues/778

The daemon JVM crash with a thread dump. The relevant portion of the thread dump shows an issue with the version of Jansi used by Gradle.

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.fusesource.jansi.internal.CLibrary.init()V+0
j  org.fusesource.jansi.internal.CLibrary.<clinit>()V+21
v  ~StubRoutines::call_stub
j  org.fusesource.jansi.AnsiConsole.wrapOutputStream(Ljava/io/OutputStream;)Ljava/io/OutputStream;+61
j  org.fusesource.jansi.AnsiConsole.<clinit>()V+13
v  ~StubRoutines::call_stub
j  com.dslplatform.compiler.client.Context.<init>()V+1
j  com.dslplatform.json.AnnotationCompiler$DslContext.<init>(Ljavax/annotation/processing/Messager;Lcom/dslplatform/json/AnnotationCompiler$LogLevel;)V+1
j  com.dslplatform.json.AnnotationCompiler.buildExternalJson(Ljava/lang/String;Lcom/dslplatform/json/AnnotationCompiler$CompileOptions;Lcom/dslplatform/json/AnnotationCompiler$LogLevel;Ljavax/annotation/processing/Messager;)Ljava/lang/String;+40
j  com.dslplatform.json.CompiledJsonProcessor.process(Ljava/util/Set;Ljavax/annotation/processing/RoundEnvironment;)Z+244
j  com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(Ljavax/annotation/processing/Processor;Ljava/util/Set;Ljavax/annotation/processing/RoundEnvironment;)Z+3

In this case an annotation processor used by the Java compiler provides its own version of Jansi. Gradle sets a custom library path for the Jansi library for extraction and consumption which doesn't seem to be compatible with the provided Jansi version of the annotation processor. A bug in Jansi seems to cause a horrible crash of the JVM.

A workaround is to fork the Java compilation process.

compileJava {
    options.fork = true

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 24/Jan/17 ]

We'll continue to track the work on GitHub.

Generated at Wed Jun 30 12:52:26 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.