solana-labs / rbpf

Rust virtual machine and JIT compiler for eBPF programs
Apache License 2.0
277 stars 169 forks source link

chore: upgrade hash32 and silence miri false positive #618

Open 0xalpharush opened 1 week ago

0xalpharush commented 1 week ago

The current version of hash32 is about a year older than the one most recently released and has some behavior that is (incorrectly) flagged as undefined behavior (UB) by tools like Miri. This prevents any tool downstream of rbpf from using the rustc flags and tools like miri to identify UB as it will fail (xref https://github.com/rust-embedded-community/hash32/pull/14).

$ RUSTFLAGS="-Zstrict-init-checks" cargo +nightly test
thread 'elf::test::test_entrypoint' panicked at core/src/panicking.rs:221:5:
attempted to leave type `murmur3::Buffer` uninitialized, which is invalid
thread caused non-unwinding panic. aborting.

Upgrading hash32 fixes this.