Skip to content

Delay initialization of io.netty.handler.codec.compression.BrotliDecoder to runtime#11428

Merged
normanmaurer merged 1 commit into
netty:4.1from
gradinac:http-codec-native-build-failure
Jul 1, 2021
Merged

Delay initialization of io.netty.handler.codec.compression.BrotliDecoder to runtime#11428
normanmaurer merged 1 commit into
netty:4.1from
gradinac:http-codec-native-build-failure

Conversation

@gradinac
Copy link
Copy Markdown
Contributor

Motivation:
See #11427

Modification:
By delaying the initialization of io.netty.handler.codec.compression.BrotliDecoder to runtime, native-image will not try to eagerly initialize the class during the image build, avoiding the build failure described in the issue.

Fixes #11427

@normanmaurer
Copy link
Copy Markdown
Member

@gradinac can you sign our icla: https://netty.io/s/icla ?

@gradinac
Copy link
Copy Markdown
Contributor Author

@normanmaurer I've requested an approval to sign it - will sign it and let you know as soon as I get a green light on it

@normanmaurer
Copy link
Copy Markdown
Member

@chrisvest any idea why the build would fail with graal ?

@gradinac
Copy link
Copy Markdown
Contributor Author

gradinac commented Jul 1, 2021

Looking at surefire reports of the build, this seems to be a crash in the JVM:

# Created at 2021-06-30T12:21:57.124
Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream '# A fatal error has been detected by the Java Runtime Environment:'.
# Created at 2021-06-30T12:21:57.124
Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream '#  SIGSEGV (0xb) at pc=0x00007f3ac8a088f2, pid=8110, tid=8123'.

These failures usually produce a hs_err file that can be very useful for debugging, though I'm not sure if it's picked up by the gate - for this particular crash, the file is located at:

# Created at 2021-06-30T12:21:57.124
Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream '# /code/resolver/hs_err_pid8110.log'.
java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third character in command '# /code/resolver/hs_err_pid8110.log'.

This is most likely a bug and will probably not happen again if we re-run the job. One thing I've noticed is that the GraalVM version used in the gate is very old:

# Created at 2021-06-30T12:21:57.124
Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream '# JRE version: OpenJDK Runtime Environment GraalVM CE 20.1.0 (11.0.7+10) (build 11.0.7+10-jvmci-20.1-b02)'.

It may be worth bumping it to 21.1 (or wait a bit more for 21.2 to be released) - the cause of this crash might have already been addressed in the newest version

@gradinac
Copy link
Copy Markdown
Contributor Author

gradinac commented Jul 1, 2021

@normanmaurer I have signed the ICLA

@normanmaurer normanmaurer added this to the 4.1.66.Final milestone Jul 1, 2021
@normanmaurer normanmaurer merged commit bc206ff into netty:4.1 Jul 1, 2021
@normanmaurer
Copy link
Copy Markdown
Member

@gradinac thanks a lot!

normanmaurer pushed a commit that referenced this pull request Jul 1, 2021
…der to runtime (#11428)

Motivation:
Including codec-http in the project and building a native-image out of it using a GraalVM 21.2 nightly can result in a failure.

Modification:
By delaying the initialization of `io.netty.handler.codec.compression.BrotliDecoder` to runtime, native-image will not try to eagerly initialize the class during the image build, avoiding the build failure described in the issue.

Result:
Fixes #11427
@gradinac
Copy link
Copy Markdown
Contributor Author

gradinac commented Jul 1, 2021

@normanmaurer thank you very much for reviewing and merging this PR! :)

@gradinac gradinac deleted the http-codec-native-build-failure branch July 1, 2021 13:23
raidyue pushed a commit to raidyue/netty that referenced this pull request Jul 8, 2022
…der to runtime (netty#11428)

Motivation:
Including codec-http in the project and building a native-image out of it using a GraalVM 21.2 nightly can result in a failure.

Modification:
By delaying the initialization of `io.netty.handler.codec.compression.BrotliDecoder` to runtime, native-image will not try to eagerly initialize the class during the image build, avoiding the build failure described in the issue.

Result:
Fixes netty#11427
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

Successfully merging this pull request may close these issues.

Native-image build failure when using codec-http on GraalVM 21.2 dev

2 participants