Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bench failed on Windows #37

Closed
chawyehsu opened this issue Jun 15, 2021 · 7 comments · Fixed by #79
Closed

bench failed on Windows #37

chawyehsu opened this issue Jun 15, 2021 · 7 comments · Fixed by #79

Comments

@chawyehsu
Copy link

chawyehsu commented Jun 15, 2021

env: Windows 10 x86_64, Rust nightly-gnu [rustc 1.55.0-nightly (539d7bd39 2021-06-14)]

❯ cargo +nightly-gnu bench -vvv
       Fresh cc v1.0.61
       Fresh md5-asm v0.5.0 (C:\workspace\repos\github.com\RustCrypto\asm-hashes\md5)
    Finished bench [optimized] target(s) in 0.04s
     Running `C:\workspace\repos\github.com\RustCrypto\asm-hashes\target\release\deps\md5_asm-4aede987d9726e5b.exe --bench`

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running `C:\workspace\repos\github.com\RustCrypto\asm-hashes\target\release\deps\lib-dab98c6ec0ebcfb5.exe --bench`

running 1 test
error: bench failed

How can I fix this?

@tarcieri tarcieri changed the title bench failed bench failed on Windows Jun 15, 2021
@tarcieri
Copy link
Member

Hmm, I'm not quite sure what's happening there. While we do have CI for those environments, we don't test the benchmarks, nor do I have access to a Windows machine to confirm myself.

I've never seen "bench failed" before. Is it panicking?

Can you try going into the individual directories and running the benchmarks? It looks like md5-asm is failing there, but do the other benchmarks fail in the same way if you run them individually?

@chawyehsu
Copy link
Author

@tarcieri Unfortunately, I ran them individually and all of them fail with the same error and no other output. The build is successful, but I don't know it's panicking or not since the only message I can see is the one of error: bench failed.

@tarcieri
Copy link
Member

tarcieri commented Jun 15, 2021

Wow, that's really confusing.

Can you try running the binary under a debugger like gdb? Something like:

$ gdb C:\workspace\repos\github.com\RustCrypto\asm-hashes\target\release\deps\lib-dab98c6ec0ebcfb5.exe
(gdb) run --bench

@chawyehsu
Copy link
Author

chawyehsu commented Jun 15, 2021

(gdb) run --bench
Starting program: C:\workspace\repos\github.com\RustCrypto\asm-hashes\target\release\deps\lib-be2dc135b8dd9613.exe --bench
[New Thread 5852.0x4c18]
[New Thread 5852.0x8688]
[New Thread 5852.0x5fe0]

running 1 test

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ff6dcb61f1d in md5_compress ()
(gdb) info registers
rax            0x1fe64             130660
rbx            0x8b741fe6a0        598948701856
rcx            0x8b741fe6a0        598948701856
rdx            0x11034064          285425764
rsi            0x7d0               2000
rdi            0x11034064          285425764
rbp            0x7d0               0x7d0
rsp            0x8b741fe2a8        0x8b741fe2a8
r8             0xff                255
r9             0x7ffee000          2147409920
r10            0x1                 1
r11            0x467e00b301        302761685761
r12            0x8b741fe3e0        598948701152
r13            0x8b741fe370        598948701040
r14            0x8b741fe3e8        598948701160
r15            0x8b741fe300        598948700928
rip            0x7ff6dcb61f1d      0x7ff6dcb61f1d <md5_compress+13>
eflags         0x10206             [ PF IF RF ]
cs             0x33                51
ss             0x2b                43
ds             0x2b                43
es             0x2b                43
fs             0x53                83
gs             0x2b                43

@tarcieri
Copy link
Member

Okay, that's helpful! Can you run info registers?

@chawyehsu
Copy link
Author

I edited the comment and added the info.

@tarcieri
Copy link
Member

Thanks! I'll try to look into this a bit more when I have time, but it seems like the kind of problem where I might need to set up a Windows VM to debug.

Really we should probably just switch to better assembly implementations (see #5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants