Skip to content

rustc crash trying to compile p384 for Wasi on ppc64le #104021

Closed as not planned
Closed as not planned
@rjzak

Description

@rjzak

I tried this code:

I expected to see this happen:

  • Compiling for powerpc64le-unknown-linux-gnu works fine.
  • Compiling for x86_64-unknown-linux-gnu and wasm32-wasi from x86_64-unknown-linux-gnu also works fine.
  • This code compiles fine in a PR, all unit tests pass for x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl, and wasm32-wasi from Github's Ubuntu CI runner. chore: refactor crypto, attestation into crates enarx/steward#92

Instead, this happened: (signal: 11, SIGSEGV: invalid memory reference)

Meta

rustc --version --verbose:

rustc 1.65.0 (897e37553 2022-11-02)
binary: rustc
commit-hash: 897e37553bba8b42751c67658967889d11ecd120
commit-date: 2022-11-02
host: powerpc64le-unknown-linux-gnu
release: 1.65.0
LLVM version: 15.0.0

I also tried nightly:

rustc 1.67.0-nightly (09508489e 2022-11-04)
binary: rustc
commit-hash: 09508489efc223287731fe8abbd2a81bbf7adf8e
commit-date: 2022-11-04
host: powerpc64le-unknown-linux-gnu
release: 1.67.0-nightly
LLVM version: 15.0.4
Backtrace

cargo build --target=wasm32-wasi
   Compiling version_check v0.9.4
   Compiling proc-macro2 v1.0.47
   Compiling unicode-ident v1.0.5
   Compiling quote v1.0.21
   Compiling typenum v1.15.0
   Compiling const-oid v0.9.0
   Compiling cfg-if v1.0.0
   Compiling syn v1.0.102
   Compiling wasi v0.11.0+wasi-snapshot-preview1
   Compiling subtle v2.4.1
   Compiling zeroize v1.5.7
   Compiling base64ct v1.5.3
   Compiling autocfg v1.1.0
   Compiling flagset v0.4.3
   Compiling libm v0.2.5
   Compiling base16ct v0.1.1
   Compiling ppv-lite86 v0.2.16
   Compiling num-bigint-dig v0.8.1
   Compiling spin v0.5.2
   Compiling anyhow v1.0.66
   Compiling smallvec v1.10.0
   Compiling byteorder v1.4.3
   Compiling base64 v0.13.1
   Compiling lazy_static v1.4.0
   Compiling getrandom v0.2.7
   Compiling pem-rfc7468 v0.6.0
   Compiling rustls-pemfile v1.0.1
   Compiling generic-array v0.14.6
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling rand_core v0.6.4
   Compiling num-traits v0.2.15
   Compiling num-integer v0.1.45
   Compiling num-iter v0.1.43
   Compiling ff v0.12.0
   Compiling rand_chacha v0.3.1
   Compiling group v0.12.1
   Compiling rand v0.8.5
   Compiling block-buffer v0.10.3
   Compiling crypto-common v0.1.6
   Compiling crypto-bigint v0.4.9
   Compiling digest v0.10.5
   Compiling hmac v0.12.1
   Compiling signature v1.6.4
   Compiling sha2 v0.10.6
   Compiling rfc6979 v0.3.0
   Compiling der_derive v0.6.0
   Compiling der v0.6.0
   Compiling spki v0.6.0
   Compiling pkcs8 v0.9.0
   Compiling x509-cert v0.1.0
   Compiling sec1 v0.3.0
   Compiling pkcs1 v0.4.1
   Compiling rsa v0.7.1
   Compiling elliptic-curve v0.12.3
   Compiling ecdsa v0.14.8
   Compiling p384 v0.11.2
   Compiling p256 v0.11.1
   Compiling cryptography v0.2.0 (/home/rjzak/CLionProjects/Profian/steward/crates/cryptography)
/home/rjzak/.rustup/toolchains/nightly-powerpc64le-unknown-linux-gnu/bin/../lib/librustc_driver-a16a56f1ee9bc30d.so(+0xd1da4c)[0x3f5f2831da4c]
linux-vdso64.so.1(__kernel_sigtramp_rt64+0x0)[0x3f5f31e32444]
/home/rjzak/.rustup/toolchains/nightly-powerpc64le-unknown-linux-gnu/bin/../lib/librustc_driver-a16a56f1ee9bc30d.so(+0x43d9eb0)[0x3f5f2b9d9eb0]
--prior line repeated maybe 100 times--
/home/rjzak/.rustup/toolchains/nightly-powerpc64le-unknown-linux-gnu/bin/../lib/librustc_driver-a16a56f1ee9bc30d.so(+0x43e39f0)[0x3f5f2b9e39f0]
error: could not compile `cryptography`

Caused by:
  process didn't exit successfully: `rustc --crate-name cryptography --edition=2021 crates/cryptography/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=6488b55d5ee2565a -C extra-filename=-6488b55d5ee2565a --out-dir /home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps --target wasm32-wasi -C incremental=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/incremental -L dependency=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps -L dependency=/home/rjzak/CLionProjects/Profian/steward/target/debug/deps --extern anyhow=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/libanyhow-1ba77a1f5c8dcfc8.rmeta --extern const_oid=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/libconst_oid-b0de089666901db1.rmeta --extern der=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/libder-270eb04288fc3862.rmeta --extern p256=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/libp256-bd3b55e4430baa37.rmeta --extern p384=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/libp384-867a0ed9c2a8f084.rmeta --extern rand=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/librand-2cff48b4013c83b5.rmeta --extern rsa=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/librsa-8725bf5d5b0de6bd.rmeta --extern rustls_pemfile=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/librustls_pemfile-ef9956d1b0020325.rmeta --extern sec1=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/libsec1-f5887e063c6bdaba.rmeta --extern sha2=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/libsha2-43a9895c64d32782.rmeta --extern signature=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/libsignature-43977adb265e87d7.rmeta --extern spki=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/libspki-a7058dda7ec5239b.rmeta --extern x509=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/libx509_cert-9b66f6c9bc134ce0.rmeta --extern zeroize=/home/rjzak/CLionProjects/Profian/steward/target/wasm32-wasi/debug/deps/libzeroize-2a8947187ca03ce5.rmeta --cfg tokio_unstable` (signal: 11, SIGSEGV: invalid memory reference)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions