You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tal Inbar (Jira)" <ji...@apache.org> on 2022/08/18 09:53:00 UTC

[jira] [Created] (MCOMPILER-504) Multi threaded compile crashes with a LifecycleExecutionException

Tal Inbar created MCOMPILER-504:
-----------------------------------

             Summary: Multi threaded compile crashes with a LifecycleExecutionException
                 Key: MCOMPILER-504
                 URL: https://issues.apache.org/jira/browse/MCOMPILER-504
             Project: Maven Compiler Plugin
          Issue Type: Bug
    Affects Versions: 3.10.1, 3.8.1
            Reporter: Tal Inbar
         Attachments: maven compiler IllegalStateException - Stack trace.txt

Compiling with multiple threads yields an org.apache.maven.lifecycle.LifecycleExecutionException which is caused by a java.lang.IllegalStateException as the first exception on the stack:

Caused by: java.lang.IllegalStateException: Current state = CODING_END, new state = FLUSHED
    at java.nio.charset.CharsetDecoder.throwIllegalStateException (CharsetDecoder.java:998)

 

The compilation is performed for a multi-module project.

The issue is produced on WSL2 (Ubuntu 20.04), with Windows 11 Enterprise Version 10.0.22621 Build 22621, using Maven version 3.8.6 and Maven compiler plugin v3.10.1. JDK version is 15.0.2.

The issue is also reproducible on Windows 11 natively with the same version as above, using Maven version 3.6.1 and Maven compiler plugin v3.8.1, although on windows the compile time is slower and the error occurs less frequently. JDK version is 15.0.2 as well.

Compilation was performed using the command `mvn -X -T 1C compile -DskipTests`.

The issue can be worked around by using less threads (although the issue can still occur) or by using the `<fork>true</fork>` parameter with the `<executable>/path/to/java_home/bin/javac</executable>` parameter, although this causes compilation to be two times slower and is less desirable (1 minute compile time for our project compared to 30 seconds without fork, or 2 minutes vs 1 minute if using `mvn install`).

I have attached a text file which includes the full stack trace (the name of the compiled project displayed in the stack trace was replaced with <project-name>).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)