jetscii: jetscii returns incorrect result in mysterious circumstances
I’ve reduced this as much as I can, but it disappears if I reduce it any further.
The code is here: https://github.com/brson/searchtest/blob/jetsciibug/src/lib.rs#L16
On the jetsciibug branch of my searchtest repo. The bug shows up in a benchmark, where jetscii returns the wrong result. This happens on both beta and nightly, the versions of which are printed below. This is using RUSTC_BOOTSTRAP to test benchmarking on beta.
This happens with target-cpu=x86_64 but not with target-cpu=skylake. I haven’t tested any other targets.
brian@DESKTOP-UCV672I:~/searchtest⟫ RUSTC_BOOTSTRAP=1 RUSTFLAGS="-C target-cpu=x86-64" cargo +beta bench -- --nocapture
Finished release [optimized] target(s) in 0.03s
Running target/release/deps/searchtest-ae1a210660c35b0a
running 1 test
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `Some(64)`,
right: `Some(419)`', src/lib.rs:20:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
test find_from_set_jetscii_bytes_lipsum_emph ... FAILED
failures:
failures:
find_from_set_jetscii_bytes_lipsum_emph
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
error: bench failed
101 brian@DESKTOP-UCV672I:~/searchtest⟫ rustc +beta --version
rustc 1.27.0-beta.5 (84b5a46f8 2018-05-15)
brian@DESKTOP-UCV672I:~/searchtest⟫ RUSTC_BOOTSTRAP=1 RUSTFLAGS="-C target-cpu=x86-64" cargo +nightly bench -- --nocapture
Compiling searchtest v0.1.0 (file:///home/brian/searchtest)
Finished release [optimized] target(s) in 1.75s
Running target/release/deps/searchtest-191788c2bec2b787
running 1 test
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `Some(64)`,
right: `Some(419)`', src/lib.rs:20:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
test find_from_set_jetscii_bytes_lipsum_emph ... FAILED
failures:
failures:
find_from_set_jetscii_bytes_lipsum_emph
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
error: bench failed
101 brian@DESKTOP-UCV672I:~/searchtest⟫ rustc +nightly --version
rustc 1.27.0-nightly (f0fdaba04 2018-05-15)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 23 (4 by maintainers)
Commits related to this issue
- Don't report a false positive when all matches are before a misalignment Also add a proptest which tests different starting offsets Closes #19 — committed to shepmaster/jetscii by shepmaster 6 years ago
across the board, no unusual errors using the “misalignment-false-positive” branch. much better!