ashvardanian / StringZilla

Up to 10x faster strings for C, C++, Python, Rust, and Swift, leveraging SWAR and SIMD on Arm Neon and x86 AVX2 & AVX-512-capable chips to accelerate search, sort, edit distances, alignment scores, etc 🦖
https://ashvardanian.com/posts/stringzilla/
Apache License 2.0
1.92k stars 64 forks source link

[BUG] Instant error STATUS_ACCESS_VIOLATION on Windows with Rust lib #116

Closed 0xqd closed 2 months ago

0xqd commented 4 months ago

I got instant STATUS_ACCESS_VIOLATION while running the memchr_stringzilla benchmark, it works totally fine with WSL2 on Windows but not on Windows itself.

ashvardanian commented 4 months ago

Thanks for submitting the issue, @0xqd! Can you please clarify if you've detected an issue with the benchmark or the library itself?

0xqd commented 4 months ago

@ashvardanian The repo I use to reproduce is the one from you: https://github.com/ashvardanian/memchr_vs_stringzilla

Environment the script run on:

cargo --version
cargo 1.76.0 (c84b36747 2024-01-18)

winver
Version 22H2 (OS Build 22621.1702)

Error

Gnuplot not found, using plotters backend
Benchmarking search-forward/stringzilla::find
Benchmarking search-forward/stringzilla::find: Warming up for 10.000 s
Error: Failed to receive message from Criterion.rs benchmark bench

Caused by:
    An existing connection was forcibly closed by the remote host. (os error 10054)

I edit the title of the post to proper error message

Minimal reproducible code:

#[cfg(test)]
mod tests {
    use stringzilla::{sz};

    #[test]
    fn test_stringzilla() {
        sz::find("hello", "l");
    }
}

Error:

process didn't exit successfully: `<path>\b2d8f6d198f2a16b.exe app::tests::test_stringzilla --format=json --exact -Z unstable-options --show-output` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
ashvardanian commented 4 months ago

@0xqd What kind of Windows machine are you running on? Is that a Aarch64 Arm-based machine by any chance?

ashvardanian commented 4 months ago

This might be coming from Rust itself, there is a similar issue reported for Arm-based Windows setups: https://github.com/rust-lang/rust/issues/118462

0xqd commented 4 months ago

@ashvardanian it's x86_64 with Intel 13900K. Yeah I have seen that report, not sure if you have the solution.

ashvardanian commented 3 months ago

Is that issue still bothering you, @0xqd? I can try running it on a Windows machine later today 🤗

0xqd commented 3 months ago

hi there @ashvardanian, instead of using Windows just for convenience, I switch everything to Linux to be problem free now.

ashvardanian commented 3 months ago

That should make your life easier down the road 🤗