-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JVM Crashing in Dockerized Alpine Environment #25
Comments
Thanks for providing detailed steps for reproducing. I was able to reproduce the issue with the After taking a look at the core dump, it looks like the issue is inside the function Since installing glibc on Alpine or statically linking with glibc are not recommended, it looks like the best approach here might be to change the |
If this is the path we'll follow, I'd really enjoy opening a PR to change that during the weekend. |
No, we shouldn't have any dependency on glibc itself. The core library has been tested with Alpine Linux and musl itself, and with MSVC. cc @dfellis @isaachier @nrabinowitz in case there's something I'm not considering about statically linking to a different libc. |
@isaacbrodsky statically linking libc is generally a bad idea, and I think affects the licensing of the resulting binary (https://lwn.net/Articles/117972/), so H3 doesn't do that. |
@isaachier I believe the idea is to statically link musl, actualy. musl has a MIT license |
I don't really like the idea of statically linking Musl to support one uncommon Linux variant. If we're going to support this, I'd rather we do some autoconf-like detection of which library, glibc or musl, to link to, and to use the OS-provided one. Otherwise we're opening ourselves to an upgrade treadmill for all security updates to musl. |
@dgmneto I think @isaacbrodsky helped me find the underlying problem. Here is a quote from the musl FAQ:
|
I'll have to disagree with @dfellis on how uncommon Alpine is: in the docker world Alpine is usually used to reduce layer/image sizes. Even so, I get your point. |
@isaacbrodsky somewhat related question: Would it make sense to use |
I don't want to get into a Linux distro flamewar (Linux is my daily driver, I've had enough of those over the years), I wanted to point out that we could easily tangle ourselves into a support nightmare when we look beyond the top 10 Linux distros (Alpine is currently 65th according to Distrowatch, and even in the world of Docker, Alpine has half the stars of Ubuntu). |
@dfellis I understand your position, but you'd be surprised about how many docker images use Alpine as a base. Stars aside, I wonder if there is a way to search for base image "spinoffs." |
See here for known issues with libraries on Alpine Linux: https://github.com/gliderlabs/docker-alpine/blob/master/docs/caveats.md. |
A good solution would be to package H3 itself as a package in Alpine, then H3-Java and other bindings can use the system provided core library. edit: this would be limited by the need for JNI adapter functions. The other option would be for Alpine users to build H3-Java on Alpine Linux and use the built artifact from there. That should be fully compatible with Alpine. |
Yes that would work but you will have a lot of package systems to work with (debian, rpm, etc.). |
This is the code I'm using to reproduce the problem:
I'm using the gradle docker plugin to build the docker images. The project with the crashing scenario and setup is available here.
To build the image, run
./gradlew dockerBuildImage
. Then rundocker run -it divinomenezes/h3-issue-test:latest
to run the code. You should be able to run normally.If you change the
build.gradle:27
as described in the comment and rerun the steps above, you should see the following error:The
hs_err_pid1.log
is also available here.The text was updated successfully, but these errors were encountered: