Closed kpcyrd closed 3 years ago
This sounds like https://github.com/rust-lang/compiler-team/issues/422.
Likely, I modified the Dockerfile like this;
FROM rust:alpine3.13
ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN apk add cargo postgresql-dev
WORKDIR /app
COPY . .
RUN cargo build --release
ENTRYPOINT ["/app/target/release/alpine-pq-sigsegv-repro"]
And now it's working;
Recreating alpine-pq-repro_foo_1 ... done
Attaching to alpine-pq-repro_foo_1
foo_1 | [*] Trying to cause segfault
foo_1 | [+] No segfault! Result is: ERR (but that's ok)
alpine-pq-repro_foo_1 exited with code 0
%
I found a segfault when using postgres on the rust docker images that I can't reproduce with rustc from the official alpine images:
Binary built on
alpine:*
images (3.13
andedge
):Binary built on
rust:alpine3.13
image:The debian based rust container and compiling/running it on Arch Linux works fine.
I have a minimal reproducer, to reproduce it run
docker-compose up --build
, the required files are:Dockerfile
src/main.rs
Cargo.toml
docker-compose.yml
Cargo.lock (optional)