takashi-ishio / selogger

(Near-)omniscient debugging/tracing/logging tool for Java
Other
35 stars 8 forks source link

Corrupted channel by directly writing to native stream in forked JVM #26

Closed takashi-ishio closed 2 years ago

takashi-ishio commented 2 years ago

When maven-surefire-plugin uses parallel testing (e.g. <forkCount>2</forkCount>), Maven may report the following error message.

Corrupted channel by directly writing to native stream in forked JVM

This is because SELogger used STDOUT to report some error messages at runtime.

The problem is reproducible with Maven 3.6.
Building apache/commons-Lang repo with the following configuration for maven-surefire-plugin.

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${commons.surefire.version}</version>
<configuration>
<argLine>-javaagent:/home/ishio/selogger/target/selogger-0.4.0.jar=output=/</argLine>
<forkCount>2</forkCount>
</configuration>

In this example, / is selected as an output directory. SELogger writes an error message / is not writable directory to STDOUT; it resulted in the warning.