question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Throwing an exception in case glibc is missing instead of segfaulting the JVM

See original GitHub issue

It seems Netty’s native support depends on glibc (btw is this documented?). When glibc is missing (for example using vanilla Alpine), the JVM could end up with a crash (SIGSEGV), see details in this issue: https://github.com/micrometer-metrics/micrometer/issues/2776

It also seems that Epoll.isAvailable() returns true even if glibc is missing.

Expected behavior

Throwing an exception

Actual behavior

JVM crash

Steps to reproduce

Using Netty native with an environment that does not have glibc, e.g.: vanilla Alpine

Minimal yet complete reproducer code (or URL to code)

This seems to be a known issue, please let me know if you really need a reproducer.

Netty version

4.1.68 (latest)

JVM version (e.g. java -version)

Latest 11:

 ❯ docker run --rm 'azul/zulu-openjdk-alpine:11-jre' 'sh' '-c' 'java --version'
openjdk 11.0.12 2021-07-20 LTS
OpenJDK Runtime Environment Zulu11.50+19-CA (build 11.0.12+7-LTS)
OpenJDK 64-Bit Server VM Zulu11.50+19-CA (build 11.0.12+7-LTS, mixed mode)

Or also latest 17:

 ❯ docker run --rm 'bellsoft/liberica-openjdk-alpine-musl:17' 'sh' '-c' 'java --version'
openjdk 17 2021-09-14 LTS
OpenJDK Runtime Environment (build 17+35-LTS)
OpenJDK 64-Bit Server VM (build 17+35-LTS, mixed mode)

I assume this is an issue in every JRE that is currently supported.

OS version (e.g. uname -a)

Both images above have the same output:

 ❯ docker run --rm 'azul/zulu-openjdk-alpine:11-jre' 'sh' '-c' 'uname -a'
Linux 1ee8d1090f14 5.10.47-linuxkit #1 SMP Sat Jul 3 21:51:47 UTC 2021 x86_64 Linux

I assume this is an issue in every OS where glibc is missing.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
normanmaurercommented, Oct 11, 2021

reopened

1reaction
chrisvestcommented, Sep 29, 2021

I have updated the documentation on the native transports to note that musl is not officially supported: https://github.com/netty/netty/wiki/Native-transports

I think that’s the best we can do for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible for a Java program to detect at runtime if the jvm is ...
Throwing an exception in case glibc is missing instead of segfaulting the JVM ... When glibc is missing (for example using vanilla Alpine),...
Read more >
Java SDK crashes the JVM on Alpine docker image
If we upgrade to version 3.1.0 or later the JVM crashes during start… ... exception in case glibc is missing instead of segfaulting...
Read more >
Netty 4.1.77.Final released - Netty.news
Enable debugging of asynchronous tasks in Intellij (#12319); Throwing an exception in case glibc is missing instead of segfaulting the JVM (# ...
Read more >
How can I catch SIGSEGV (segmentation fault) and get a stack ...
If you can start the Java VM through a wrapper script, you can check if the app exited abnormally, and do the error...
Read more >
Stack Overflow handling in HotSpot JVM - Pangin.pro
But how does JVM know when it's time to throw an error? ... In most cases, the stack overflow check in C1- or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found