Segmentation fault and __strdup: symbol not found under Alpine Linux
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 836
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 7
Description
I have .NET 8.0 application which uses NuGet package Grpc.Core 2.46.6 and runs under Alpine Linux (mcr.microsoft.com/dotnet/runtime:8.0-alpine).
I also have following packages preinstalled:
apk add --no-cache
aws-cli
gcompat
icu-data-full
icu-libs
The app crashes with segmentation fault rather often (dozens times a week).
Since the only native library in this app is grpc I tried to investigate what could be wrong with that:
ldd /app/2.46.6/runtimes/linux-x64/native/libgrpc_csharp_ext.x64.so
/lib/ld-musl-x86_64.so.1 (0x7f7475914000)
libdl.so.2 => /lib/ld-musl-x86_64.so.1 (0x7f7475914000)
librt.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f7475914000)
libm.so.6 => /lib/ld-musl-x86_64.so.1 (0x7f7475914000)
libpthread.so.0 => /lib/ld-musl-x86_64.so.1 (0x7f7475914000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f7474c9f000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f7474c7b000)
libc.so.6 => /lib/ld-musl-x86_64.so.1 (0x7f7475914000)
ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x7f7474c74000)
Error relocating /app/2.46.6/runtimes/linux-x64/native/libgrpc_csharp_ext.x64.so: __strdup: symbol not found
Installing additional packages did not help:
apk add --no-cache \
cmake \
curl \
g++ \
gcc \
jpeg-dev \
libffi-dev \
libjpeg \
make \
musl-dev \
musl \
postgresql-dev \
python3-dev \
tzdata \
zlib \
zlib-dev \
libc6-compat \
libc-dev \
alpine-sdk \
build-base \
linux-headers \
cython \
c-ares-dev \
gdbm \
libffi \
aws-cli \
gcompat \
icu-data-full \
icu-libs
Could, please, anyone provide full list of native dependencies required for Grpc.Core 2.46.6?
Also, could anyone provide any other suggestions on how to resolve that issue other than migrating to the new Grpc.Net.Client?
Contributor guide
Research direction
Start by reproducing the failure in mcr.microsoft.com/dotnet/runtime:8.0-alpine with Grpc.Core 2.46.6 and inspect runtimes/linux-x64/native/libgrpc_csharp_ext.x64.so using the reported ldd command. Compare the installed Alpine packages and native dependency errors; done means documenting the full required dependency set or a confirmed alternative resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, grpc, linux
- Domain
- api, backend, operating-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100