Stream: git-wasmtime

Topic: wasmtime / issue #10406 Cranelift: Invalid memory reference


view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 07:30):

Ludea added the bug label to Issue #10406.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 07:30):

Ludea added the cranelift label to Issue #10406.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 07:30):

Ludea opened issue #10406:

Thanks for filing an issue! Please fill out the TODOs below.

.clif Test Case

paste .clif test case here. Ideally, a test case that has been reduced via
the `clif-util bugpoint` command.

Steps to Reproduce

1- create a rust app
2- run cargo add wastime
3- run cargo build

Expected Results

Successfull build my app

What do you expect to happen?
build wastime with default feature successuflly

Actual Results

unable to build cranelift-codegen

What actually happens? Panic? Segfault? Incorrect result?
(signal 11, SIGSEGV: invalid memory reference)

Versions and Environment

Cranelift version or commit:
wasmtime 0.30.2, with default feature

Operating system:
Android

Architecture:
aarch64

Extra Info

Anything else you'd like to add?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 08:31):

bjorn3 commented on issue #10406:

What system did you try building on? And which rustc version did you use?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 08:41):

Ludea commented on issue #10406:

Rust version : 1.84.1
I try to build on mobile device

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 09:01):

bjorn3 commented on issue #10406:

Is it rustc that segfaults or a build script?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 09:07):

Ludea commented on issue #10406:

it's from rustc

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 09:08):

Ludea edited a comment on issue #10406:

it's from rustc

could not compile `cranelift-codegen` (lib)

Caused by:
  process didn't exit successfully: `rustc --crate-name cranelift_codegen --edition=2021 /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cranelift-codegen-0.117.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=42 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 '--allow=clippy::all' --warn=unused_import_braces --warn=unused_extern_crates --warn=unused-macro-rules --warn=unused-lifetimes --warn=unstable_features --warn=unsafe-attr-outside-unsafe '--warn=clippy::unnecessary_to_owned' '--warn=clippy::unnecessary_mut_passed' '--warn=clippy::unnecessary_fallible_conversions' '--warn=clippy::unnecessary_cast' '--warn=clippy::uninlined_format_args' --warn=unexpected_cfgs --warn=trivial_numeric_casts --warn=rust-2024-prelude-collisions --warn=rust-2024-incompatible-pat --warn=rust-2024-guarded-string-incompatible-syntax --warn=missing-unsafe-on-extern '--warn=clippy::map_clone' '--warn=clippy::manual_strip' --warn=keyword_idents_2024 --warn=impl-trait-overcaptures --warn=deprecated-safe-2024 '--warn=clippy::clone_on_copy' '--warn=clippy::allow_attributes_without_reason' --check-cfg 'cfg(pulley_tail_calls)' --check-cfg 'cfg(pulley_assume_llvm_makes_tail_calls)' --cfg 'feature="gimli"' --cfg 'feature="host-arch"' --cfg 'feature="std"' --cfg 'feature="timing"' --cfg 'feature="unwind"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("all-arch", "all-native-arch", "anyhow", "arm64", "capstone", "core", "default", "disas", "enable-serde", "gimli", "host-arch", "incremental-cache", "isle-errors", "postcard", "pulley", "riscv64", "s390x", "serde", "serde_derive", "sha2", "souper-harvest", "souper-ir", "std", "timing", "trace-log", "unwind", "x86"))' -C metadata=8ceca3438a4e6be6 -C extra-filename=-8ceca3438a4e6be6 --out-dir /data/data/com.termux/files/home/lucle/target/debug/deps -L dependency=/data/data/com.termux/files/home/lucle/target/debug/deps --extern bumpalo=/data/data/com.termux/files/home/lucle/target/debug/deps/libbumpalo-60cd594841ea15d3.rmeta --extern cranelift_assembler_x64=/data/data/com.termux/files/home/lucle/target/debug/deps/libcranelift_assembler_x64-3deec114eded7b2c.rmeta --extern cranelift_bforest=/data/data/com.termux/files/home/lucle/target/debug/deps/libcranelift_bforest-bf4c3da081cf2730.rmeta --extern cranelift_bitset=/data/data/com.termux/files/home/lucle/target/debug/deps/libcranelift_bitset-9bfc4df467b1b977.rmeta --extern cranelift_codegen_shared=/data/data/com.termux/files/home/lucle/target/debug/deps/libcranelift_codegen_shared-6b3c740776c6b68a.rmeta --extern cranelift_control=/data/data/com.termux/files/home/lucle/target/debug/deps/libcranelift_control-f6a47121bff88efc.rmeta --extern cranelift_entity=/data/data/com.termux/files/home/lucle/target/debug/deps/libcranelift_entity-d303a77032a10d00.rmeta --extern gimli=/data/data/com.termux/files/home/lucle/target/debug/deps/libgimli-5f3f39779306b379.rmeta --extern hashbrown=/data/data/com.termux/files/home/lucle/target/debug/deps/libhashbrown-108b067292ceb726.rmeta --extern log=/data/data/com.termux/files/home/lucle/target/debug/deps/liblog-e301598471c6dba6.rmeta --extern regalloc2=/data/data/com.termux/files/home/lucle/target/debug/deps/libregalloc2-6e28ab3a69324b1f.rmeta --extern rustc_hash=/data/data/com.termux/files/home/lucle/target/debug/deps/librustc_hash-c1112e54603ea26d.rmeta --extern smallvec=/data/data/com.termux/files/home/lucle/target/debug/deps/libsmallvec-7a396962699c87f4.rmeta --extern target_lexicon=/data/data/com.termux/files/home/lucle/target/debug/deps/libtarget_lexicon-47121f6009da8553.rmeta --cap-lints allow --cfg 'feature="arm64"'` (signal: 11, SIGSEGV: invalid memory reference)

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 09:38):

bjorn3 commented on issue #10406:

Can you run that command in gdb to get a backtrace?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 10:10):

Ludea commented on issue #10406:

I try RUST_BACKTRACE=1 cargo build and get same message

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 14:30):

alexcrichton commented on issue #10406:

Is this using rustc_codegen_cranelift to build Cranelift? If so this issue probably belong on rustc_codegen_cranelift. If it's a general segfault compiling Rust code then this probably belongs on the rust-lang/rust issue tracker.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 14:42):

bjorn3 commented on issue #10406:

I don't think it uses cg_clif. The failing command contains neither rustc-clif nor -Zcodegen-backend. In any case I did be highly surprised if Termux were to ship cg_clif, especially on a stable rustc version.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 15:25):

Ludea commented on issue #10406:

I can use https://github.com/termux-user-repository/tur/tree/master/tur/rustc-nightly

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 16:03):

alexcrichton commented on issue #10406:

I'm trying to mostly clarify what to do with this issue on this repository. I don't know what termux is for example and the actual OP of this issue is pretty light on details (and didn't actually fill out most of the template, just used the default values). Is this something expected to be fixed in this repository?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 16:14):

Ludea closed issue #10406:

Thanks for filing an issue! Please fill out the TODOs below.

.clif Test Case

paste .clif test case here. Ideally, a test case that has been reduced via
the `clif-util bugpoint` command.

Steps to Reproduce

1- create a rust app
2- run cargo add wastime
3- run cargo build

Expected Results

Successfull build my app

What do you expect to happen?
build wastime with default feature successuflly

Actual Results

unable to build cranelift-codegen

What actually happens? Panic? Segfault? Incorrect result?
(signal 11, SIGSEGV: invalid memory reference)

Versions and Environment

Cranelift version or commit:
wasmtime 0.30.2, with default feature

Operating system:
Android

Architecture:
aarch64

Extra Info

Anything else you'd like to add?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 16:14):

Ludea commented on issue #10406:

It's not a cranelift issue, closing

view this post on Zulip Wasmtime GitHub notifications bot (Mar 22 2025 at 00:16):

Ludea commented on issue #10406:

Fixed by https://github.com/termux-user-repository/tur/commit/4dc50f8018369a1ff0b9603ef30c1aaf2c2e39f6


Last updated: Apr 16 2025 at 18:04 UTC