alexliesenfeld / httpmock

HTTP mocking library for Rust.
MIT License
435 stars 40 forks source link

Signal 11 SIGSEGV in musl build #57

Closed PumpkinSeed closed 2 years ago

PumpkinSeed commented 2 years ago

Issue

I try to run tests in a statically built environment. I need to use musl target for that. I got this error by only using this library. xxx is my binary.

Caused by:
  process didn't exit successfully: `/work/target/x86_64-unknown-linux-musl/debug/deps/xxx` (signal: 11, SIGSEGV: invalid memory reference)

Reproduce

Create any test which uses httpmock.

docker run --rm -it -e CARGO_HOME=/work/.cargo -v $(pwd):/work -w /work rust:1.57.0-alpine3.14 sh
apk add --no-cache gcc g++ musl-dev openssl-dev
RUST_LOG=libbindgen RUST_BACKTRACE=1 cargo test --target x86_64-unknown-linux-musl
alexliesenfeld commented 2 years ago

I think it might be related to https://github.com/rust-lang/rust/issues/84576 . I guess we can't really do much other than wait for it to get fixed upstream. Closing for now. Please feel free to reopen should this error still persist once the upstream issue is fixed.