Not planned
Description
Code
# Dockerfile
FROM alpine:3.8
USER root
ENV USER=root
RUN apk add --no-cache openssl openssl-dev curl gcc
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
WORKDIR /tmp
RUN sh -c "source /root/.cargo/env && cargo new --bin app"
WORKDIR /tmp/app
RUN echo 1.46.0 > rust-toolchain
RUN echo 'rand = "*"' >> Cargo.toml
RUN sh -c "source /root/.cargo/env && cargo build"
Meta
docker build .
Error output
The last step:
Step 11/11 : RUN sh -c "source /root/.cargo/env && cargo build"
---> Running in c554b90561db
info: syncing channel updates for '1.46.0-x86_64-unknown-linux-musl'
info: latest update on 2020-08-27, rust version 1.46.0 (04488afe3 2020-08-24)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: Defaulting to 500.0 MiB unpack ram
info: installing component 'clippy'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
Updating crates.io index
Downloading crates ...
Downloaded rand_chacha v0.2.2
Downloaded rand_core v0.5.1
Downloaded getrandom v0.1.14
Downloaded libc v0.2.76
Downloaded ppv-lite86 v0.2.9
Downloaded rand v0.7.3
Downloaded cfg-if v0.1.10
Compiling libc v0.2.76
Compiling getrandom v0.1.14
Compiling cfg-if v0.1.10
Compiling ppv-lite86 v0.2.9
error: failed to run custom build command for `getrandom v0.1.14`
Caused by:
process didn't exit successfully: `/tmp/app/target/debug/build/getrandom-64ae542341c0eb62/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: build failed
The command '/bin/sh -c sh -c "source /root/.cargo/env && cargo build"' returned a non-zero code: 101
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
jmjoy commentedon Aug 28, 2020
Not only crate rand, but replacing rand with log will also have this error:
tesuji commentedon Aug 28, 2020
Actually I just need
libc = "0.2"
to reproduce the issue.Bisection result
searched nightlies: from nightly-2020-06-19 to nightly-2020-06-21
regressed nightly: nightly-2020-06-20
searched commits: from e55d3f9 to 2d8bd9b
regressed commit: 63b441a
bisected with cargo-bisect-rustc v0.5.2
Host triple: x86_64-unknown-linux-musl
Reproduce with:
Most likely #70740, cc @petrochenkov as reviewer of that PR.
tesuji commentedon Aug 28, 2020
Related issue: #74757
12101111 commentedon Aug 28, 2020
I can't repoduce this on my musl based Gentoo linux system, which use musl 1.2.1.
Alpine 3.8 use musl 1.1.19 but rust CI use musl 1.1.24, and I'm sure musl don't have any binary forward compatibility (Yestday I try to downgrade musl to 1.1.24 and all programs I compile recently ware broken and show same error (signal: 11, SIGSEGV: invalid memory reference))
Other test in docker:
Alpine 3.8:
Alpine 3.9
3.10
tesuji commentedon Aug 28, 2020
Cool. @jmjoy so the answer is to upgrade alpine to newer version (easy) or just upgrade musl (hard).
This could be closed as won't fix.
LeSeulArtichaut commentedon Aug 28, 2020
Tagged this issue as
O-musl
, please correct me if that's wrongspastorino commentedon Sep 2, 2020
Assigning
P-medium
as discussed as part of the Prioritization Working Group procedure and removingI-prioritize
.6 remaining items