Skip to content
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

GLIBC symbols not found #149

Closed
crsrivats opened this issue Mar 9, 2016 · 5 comments
Closed

GLIBC symbols not found #149

crsrivats opened this issue Mar 9, 2016 · 5 comments
Labels

Comments

@crsrivats
Copy link

I am trying to run a program inside the Alpine docker container. The machine that I am creating the Docker image and running the container has a CentOS 7.2 distribution. The application was built using the x84-64 version of GCC and not using the Musl toolchain. The program has a number of shared library dependencies including glibc.

The Dockerfile is setup to download and install glibc-2.21-r2.apk. Other libraries such as libstdc++.so are being copied from the /lib64 directory of the CentOS distribution.

I can run the application in the Docker container but 'ldd' displays potential problems:

ldd /root/ut_mac
/lib64/ld-linux-x86-64.so.2 (0x7f6ee22da000)
libcjson.so => /lib/libcjson.so (0x7f6ee20d2000)
libmediashm.so.0 => /lib/libmediashm.so.0 (0x7f6ee1ecd000)
libz.so.1 => /lib/libz.so.1 (0x7f6ee1cb7000)
libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f6ee22da000)
libstdc++.so.6 => /lib/libstdc++.so.6 (0x7f6ee19af000)
librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7f6ee22da000)
libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f6ee22da000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f6ee179c000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f6ee22da000)
ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x7f6ee1578000)
Error relocating /root/ut_mac: mallopt: symbol not found
Error relocating /root/ut_mac: backtrace: symbol not found
Error relocating /root/ut_mac: __fprintf_chk: symbol not found
Error relocating /root/ut_mac: __printf_chk: symbol not found
Error relocating /root/ut_mac: __pthread_unregister_cancel: symbol not found
Error relocating /root/ut_mac: pthread_setname_np: symbol not found
Error relocating /root/ut_mac: argp_error: symbol not found
Error relocating /root/ut_mac: __pthread_register_cancel: symbol not found
Error relocating /root/ut_mac: __isnan: symbol not found
Error relocating /root/ut_mac: backtrace_symbols_fd: symbol not found
Error relocating /root/ut_mac: argp_parse: symbol not found
Error relocating /root/ut_mac: srandom_r: symbol not found
Error relocating /root/ut_mac: __sprintf_chk: symbol not found
Error relocating /root/ut_mac: initstate_r: symbol not found
Error relocating /root/ut_mac: __snprintf_chk: symbol not found
Error relocating /root/ut_mac: __strtok_r: symbol not found
Error relocating /root/ut_mac: random_r: symbol not found

Here is the Dockerfile:

FROM alpine:latest
COPY libcjson.so libmedia* libstdc++.so.6.0.19 /lib/
COPY mim* ut* /root/
RUN apk update &&
apk add --no-cache ca-certificates &&
wget "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk" &&
apk add --allow-untrusted glibc-2.21-r2.apk &&
rm glibc* &&
/usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib &&
ln -s /usr/glibc/usr/lib/ld-linux-x86-64.so.2 /lib/ld-linux-x86-64.so.2

Any help would be greatly appreciated!

@andyshinn
Copy link
Contributor

This kind of problem isn't really in scope of the Alpine Linux image. The glibc package is mostly experimental. Please try using a later version from https://github.com/andyshinn/alpine-pkg-glibc/releases and open an issue there if still have problems. A quick search reveals that some of those symbols might be from tls/libc6.so and libbacktrace.

@angelzeke
Copy link

Hi everybody,
somebody have find an issue for this problem because i try to install oracle instance on alpine and i have this error
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20160303/intl.so' - Error loading shared library libicui18n.so.57: No such file or directory (needed by /usr/local/lib/php/extensions/no-debug-non-zts-20160303/intl.so) in Unknown on line 0

I think it's the same problem
tks a lot

gabebw added a commit to gabebw/croniker that referenced this issue Dec 28, 2018
Alpine Linux is based on musl, while GHC-built binaries rely on glibc.
Therefore there's a bunch of weird errors when trying to run the image,
like "__sprintf_chk: symbol not found".

Therefore, use a glibc-based distribution like Ubuntu.

The resulting image is 332MB (Ubuntu) instead of 150MB (Alpine), but it
can actually run the programs, which is a huge point in Ubuntu's favor.

Here's a glibc-related issue on Alpine Linux:
gliderlabs/docker-alpine#149
@kilianc
Copy link

kilianc commented Mar 10, 2019

Any advices on how to fix this? I understand this might be the wrong place to look but google sends people here. Sharing workarounds or fixes is very appreciated.

@ngrodzitski
Copy link

@kilianc Try install https://pkgs.alpinelinux.org/package/edge/main/x86/libbsd or https://pkgs.alpinelinux.org/package/edge/main/x86/libbsd-dev

@kilianc
Copy link

kilianc commented Nov 14, 2019

Ok so after my investigation I realized that docker-compose stops working if gcloud auth configure-docker is called before docker-compose build.

Looks like there are some incompatibilities between gcloud sdk and docker-compose, as mention in other places as well seems related to python. Any idea how to get around this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants