| Issue |
174676
|
| Summary |
wasm-ld crash (rust build of crc-fast 1.6.0)
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
pchickey
|
Here is a crash of wasm-ld, with reproduction via lld’s --reproduce option:
[wasm-ld-crc-fast-crash.tar.gz](https://github.com/user-attachments/files/24462051/wasm-ld-crc-fast-crash.tar.gz)
Running the same through wasm-ld built with asan demonstrates there is a use-after-free, but I can't confirm that it is related.
The wasm-ld crash reproduces as a SIGSEGV for source trees within a small hamming distance of a the source checkout crc-fast 1.6.0. You can make certain changes to the source code or dependencies and it will still crash, but for instance I discovered that by updating the version in Cargo.toml to 1.7.0, it will no longer crash - that version number ends up in various symbols in the object file. I strongly suspect, based bisecting crc-fast source changes for a few hours and the investigation below, that the crash isn’t caused by anything malformed about crc-fast itself, but that something about those inputs lines things up just right to cause a crash or assertion failure.
I have reproduced this crash on both MacOS 15.7 (aarch64) and Ubuntu 24.02.3 (x86_64).
In the wild, wasm-ld (installed in the rust project as rust-lld) will crash with a SIGSEGV:
<details>
<pre>
[p.hickey@KVKD0WG7VF:src/crc-fast-rust]% git clone https://github.com/awesomized/crc-fast-rust --branch 1.6.0
Cloning into 'crc-fast-rust'...
remote: Enumerating objects: 1829, done.
remote: Counting objects: 100% (639/639), done.
remote: Compressing objects: 100% (169/169), done.
remote: Total 1829 (delta 504), reused 558 (delta 470), pack-reused 1190 (from 1)
Receiving objects: 100% (1829/1829), 1.52 MiB | 3.48 MiB/s, done.
Resolving deltas: 100% (1305/1305), done.
Note: switching to '45394b13b4270a2722266c6be772aef02059815d'.
[p.hickey@KVKD0WG7VF:src/crc-fast-rust]% cd crc-fast-rust
[p.hickey@KVKD0WG7VF:crc-fast-rust/crc-fast-rust]% cargo --version
cargo 1.92.0 (344c4567c 2025-10-21)
[p.hickey@KVKD0WG7VF:crc-fast-rust/crc-fast-rust]% cargo build --target wasm32-wasip2
Compiling wit-bindgen v0.46.0
Compiling version_check v0.9.5
Compiling typenum v1.19.0
Compiling zerocopy v0.8.27
Compiling getrandom v0.3.4
Compiling cfg-if v1.0.4
Compiling memchr v2.7.6
Compiling regex-syntax v0.8.8
Compiling rustversion v1.0.22
Compiling crc-catalog v2.4.0
Compiling aho-corasick v1.1.4
Compiling generic-array v0.14.9
Compiling crc v3.3.0
Compiling regex-automata v0.4.13
Compiling wasip2 v1.0.1+wasi-0.2.4
Compiling rand_core v0.9.3
Compiling block-buffer v0.10.4
Compiling crypto-common v0.1.6
Compiling digest v0.10.7
Compiling regex v1.12.2
Compiling ppv-lite86 v0.2.21
Compiling rand_chacha v0.9.0
Compiling rand v0.9.2
Compiling crc-fast v1.6.0 (/Users/p.hickey/src/crc-fast-rust/crc-fast-rust)
error: linking with `wasm-component-ld` failed: exit status: 1
|
= note: "wasm-component-ld" "-flavor" "wasm" "--export" "cabi_realloc" "-z" "stack-size=1048576" "--stack-first" "--allow-undefined" "--no-demangle" "<76 object files omitted>" "<sysroot>/lib/rustlib/wasm32-wasip2/lib/libpanic_abort-*.rlib" "/Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/{libcrc-e9bf5a3fb54d8c43,libcrc_catalog-2b954ecada58b52b,libdigest-19e655bc742aa5b7,libblock_buffer-4879d7a255417a1d,libcrypto_common-dcc9be42abefd1f3,libgeneric_array-17a4a1431b2b229c,libtypenum-46d8c497f70ad3aa}.rlib" "<sysroot>/lib/rustlib/wasm32-wasip2/lib/{libstd-*,libwasi-*,libwasi-*,libwit_bindgen-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*}.rlib" "-l" "c" "<sysroot>/lib/rustlib/wasm32-wasip2/lib/{librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-L" "/Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/build/wit-bindgen-0c06af0fc17a621e/out" "-L" "<sysroot>/lib/rustlib/wasm32-wasip2/lib/self-contained" "-o" "/Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.wasm" "--gc-sections" "--no-entry" "-O0"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: rust-lld -flavor wasm --export=cabi_realloc -z stack-size=1048576 --stack-first --allow-undefined --no-demangle /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.05je5b8g8gpt8m6haz22f2d15.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.077l77d8u4q7g9a9jalnqkg3i.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.0dcxn8t8ve30zsvdpiehc7gup.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.0f5z4huo1ydm52nvkkxs3ewy9.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.0f8e2p2ufcjh3au7q1z51nezt.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.0w7m46bfvdtca6rbdhmfn8j5u.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.0xvpei4kwn3auj467zcaue3hp.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.10cijm07ym6wkuneuj0yl6rxe.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.15l1dz2waw9piymkjkhl24ic9.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.16c3zu7iawcdeandr4cqypan7.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.1h1i3jt1iequf1gcxxx3m4mjv.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.1kpg5uai4tvjumru3rftuv0q3.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.1xzzsmdn3qysibqd0rzm5487k.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.21bp6ci417cel5en21xefepm6.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.2g4z0n7e29btomqzz4267j72x.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.2ir36uiorsy4dl06qr5po0ndn.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.2j4bbguoghi79t486y6m773u4.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.2krjjlyflysl1hri6c3ox7hc3.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.310jvgst7oslzej5e53rieon0.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.34os6pwjb1p32xoljio95f9fs.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.34w8q2v7s4wdy6cr1m504r7ma.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.39xs38uo09g2zpl99strm3kny.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.3jsconz79lsuiwcz4ykxx29l0.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.3v5lpnxo74ned2eq09n2bfzs4.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.3zd77p17crqwmolnt8ajfeohb.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.46brk1o5ec63tvidsy7vbcfdn.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.4fuhtb91m0rct9r1ektxjj2dp.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.4nawpm0wwya4srbti0ujhoggz.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.52st5e42xgt5nb6a6tb07kif3.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.595jyn2ks32if923rqfd1t1vt.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.5a81iessx21ydeniyoll4ucx7.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.5aamgi7ospr3e6wij4623l5jw.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.5b5udeec366afczjfecqp50dm.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.5uc8g4ssjd1j24w1eqy9fecql.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.5zzwfyuyhcuqunal425n745f0.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.62ggluxgmnnm6e457nariuakc.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.68hj1iw9giuzzwhh640szrdfg.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.6gsgrbx707dpmv6bcp0esyuen.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.6pgnl2aimxsw4aksmtbhsy7v0.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.6qrnetburkv2ggetvshs6yhbn.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.70uc21et5v5mwvbebcwiblzqk.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.762aieug1ab5gkwwu6d56c3yu.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.77bsvx4abhisrj3uon2y5e4h6.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.78wy67aae0zh8c2rmtcwlgaj1.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.7c63ydfq3ga9h32f6bdp728tu.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.7ituz68qpfy5aaq44xjjordu5.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.7wh8dggpis6oi8a5d29pczdhz.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.80o9c7wdp0yhzrmqm3ngdu5oj.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.87t7i7b2394hguen0gk4o1cu3.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.8b0kp57tlc9mwx400r9hjmh1u.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.8lv1mes2omsepz0ezkykle3wu.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.8qtv3dwwf01tjq7pqc7drf2qq.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.8rduq9bcy6npk8fhbhiz0qkaz.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.8tiyc1em4aocw2xoyt8eld2ou.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.8w46fni2sax5bfotyvuidisjf.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.911iy7e3ub37b1q8lpzrel0dz.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.916abqluvq7hioorqc17xgdrj.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.9g5ot0s0wvm7xaqvq8m1hrjjg.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.9p2pvbt0zy5ukrbpbnb824pfm.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.a4oj5fte20zn11bhz4uohtxog.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.a6mfkt39r60mpwtnzhtvqh615.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.actb0tc56m9vcnke88mos6ze6.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.aii0ghkd9swx7cih3m0swvbuq.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.aq2kpvr9y5hq5l356qakaot42.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.as1m2kxn4ctsnd8rza7dkct3w.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.bgp46wnnimy3px94wol111ehr.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.big3n3phaxj162h9n0fe7eqcm.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.bomqukqu8jvv1rium8pgm6lov.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.c0tbykef5esvw25x0ob9var8h.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.ccmoetc6tcve1fjwto0ey0nxa.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.cw5q1vxr7q5sef4e5a8m813r9.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.czf7vvcil8gqhu850m4o1id1k.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.d87yrdri0d6rv757m5d3wokaj.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.en1dzwmud3je4rces9bu7lnz5.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.f4z8aq1m6vq6tfc8xm5n2si0a.0qql4pl.rcgu.o /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/crc_fast.35d1nrx3vhep32bcyldo4brb2.0qql4pl.rcgu.o /Users/p.hickey/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libpanic_abort-58e7ca17f279ee2c.rlib /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/libcrc-e9bf5a3fb54d8c43.rlib /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/libcrc_catalog-2b954ecada58b52b.rlib /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/libdigest-19e655bc742aa5b7.rlib /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/libblock_buffer-4879d7a255417a1d.rlib /Users/p.hickey/src/crc-fast-rust/crc-fast-rust/target/wasm32-wasip2/debug/deps/lib<truncated>Please see the issue for the entire body.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs