Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.48.0: Throw "SIGSEGV: invalid memory reference" when building in RustyHermit. #76061

Closed
stlankes opened this issue Aug 29, 2020 · 2 comments
Closed
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@stlankes
Copy link
Contributor

stlankes commented Aug 29, 2020

Building libhermit-rs with the latest nightly compiler failed with a SIGSEV and the error message "invalid memory reference". My local version based on PR #75843 works fine on my system.

You see the problem also at Travis CI, where I test our unikernel on top of our hypervisor. Do you have any idea, why the compiler crashes?

Meta

rustc --version --verbose:

rustc 1.48.0-nightly (d006f5734 2020-08-28)
binary: rustc
commit-hash: d006f5734f49625c34d6fc33bf6b9967243abca8
commit-date: 2020-08-28
host: x86_64-unknown-linux-gnu
release: 1.48.0-nightly
LLVM version: 11.0

Error output

$ cargo build -Z build-std=core,alloc --target aarch64-unknown-hermit
   Compiling compiler_builtins v0.1.32
   Compiling autocfg v1.0.0
   Compiling core v0.0.0 (/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling proc-macro2 v1.0.18
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.33
   Compiling log v0.4.8
   Compiling bitflags v1.2.1
   Compiling rusty-hermit v0.3.35 (/media/psf/share/rusty-hermit/libhermit-rs)
   Compiling num-traits v0.2.12
   Compiling num-integer v0.1.43
   Compiling num-complex v0.2.4
   Compiling num-iter v0.1.41
   Compiling num-rational v0.2.4
   Compiling quote v1.0.7
   Compiling rustc-std-workspace-core v1.99.0 (/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling num-derive v0.3.0
   Compiling alloc v0.0.0 (/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
   Compiling tock-registers v0.5.0
   Compiling cfg-if v0.1.10
   Compiling register v0.5.1
   Compiling cortex-a v3.0.4
   Compiling aarch64 v0.0.4
   Compiling num v0.2.1
error: could not compile `rusty-hermit`.

Caused by:
  process didn't exit successfully: `rustc --crate-name hermit --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type staticlib --emit=dep-info,link -C opt-level=1 -C panic=abort -Cembed-bitcode=no -C debuginfo=2 -C debug-assertions=on --cfg 'feature="acpi"' --cfg 'feature="default"' --cfg 'feature="pci"' -C metadata=c27a90bd0f04b7fc -C extra-filename=-c27a90bd0f04b7fc --out-dir /media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/deps --target x86_64-unknown-hermit -C incremental=/media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/incremental -L dependency=/media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/deps -L dependency=/media/psf/share/rusty-hermit/libhermit-rs/target/debug/deps --extern 'noprelude:alloc=/media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/deps/liballoc-088de7c3bb083ba8.rlib' --extern bitflags=/media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/deps/libbitflags-43f19e4d7e744c15.rlib --extern 'noprelude:compiler_builtins=/media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/deps/libcompiler_builtins-83f1a51d3731bb3a.rlib' --extern 'noprelude:core=/media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/deps/libcore-d34760a4840521b2.rlib' --extern log=/media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/deps/liblog-1eca26a613db65fe.rlib --extern multiboot=/media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/deps/libmultiboot-17b589e37b816fc9.rlib --extern num=/media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/deps/libnum-a39d8175e004d367.rlib --extern num_derive=/media/psf/share/rusty-hermit/libhermit-rs/target/debug/deps/libnum_derive-030eb7efc88f88d8.so --extern num_traits=/media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/deps/libnum_traits-f5f3931c68156921.rlib --extern x86=/media/psf/share/rusty-hermit/libhermit-rs/target/x86_64-unknown-hermit/debug/deps/libx86-7666fd3514357218.rlib -Z unstable-options` (signal: 11, SIGSEGV: invalid memory reference)
@stlankes stlankes added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 29, 2020
@stlankes
Copy link
Contributor Author

Maybe this issue is related to #75922

@stlankes
Copy link
Contributor Author

Close this issue because we remove all naked function to avoid this problem. See hermit-os/kernel#95 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

1 participant