shadowsocks-rust: [Bug] sslocal v1.13.0 onward crashing on Windows (x86_64-pc-windows-gnu)
Since v1.13.0, sslocal crashes on startup on Windows (x86_64-pc-windows-gnu).
Interestingly, x86_64-pc-windows-msvc seems to be fine.
As an example, using a minimal sslocal configuration of:
{
"server":"ip-hidden",
"server_port":52422,
"local_port":12345,
"password":"testpassword",
"method":"chacha20-ietf-poly1305"
}
and running .\sslocal.exe -c config.json -vvv from a Windows machine yields:
TRACE [6084:8224] [shadowsocks_rust::service::local] Config { log: LogConfig { level: 3, format: LogFormatConfig { without_time: false }, config_path: None }, runtime: RuntimeConfig { worker_count: None, mode: MultiThread } }
The program exits there with no other output. Windows Event Viewer contains a log of the program crash, but no helpful information in the log, as far as I can tell.
This has been tested on v1.13.0, v1.13.1, and v1.13.2 all downloaded from the Release page.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16
Commits related to this issue
- disable md5-asm on x86 windows gnu target - ref shadowsocks/shadowsocks-rust#768 — committed to shadowsocks/shadowsocks-crypto by zonyitoo 2 years ago
- disable md5-asm, sha1-asm for windows gnu target - ref shadowsocks/shadowsocks-rust#768 — committed to shadowsocks/shadowsocks-crypto by zonyitoo 2 years ago
cargo build --bin sslocalwill do this, right? In that case, no effectsslocalserver. Then it will fail inside the creation of a newEncryptedWriterhere: https://github.com/shadowsocks/shadowsocks-rust/blob/5ffab23b72088220231bcc27d99e0a8e87080c35/crates/shadowsocks/src/relay/tcprelay/crypto_io.rs#L78 Specifically failing here: https://github.com/shadowsocks/shadowsocks-rust/blob/5ffab23b72088220231bcc27d99e0a8e87080c35/crates/shadowsocks/src/relay/tcprelay/aead.rs#L311 Which fails here: https://github.com/shadowsocks/shadowsocks-crypto/blob/724d2914238bf70630222478413c12ff50e80205/src/v1/cipher.rs#L296 Which dies in the HKDF library. In the debugger, the salt looks right in the library code, but it dies anyway somewhere in that call. Seems like library code again. The final TRACE message emitted is that it generated the AEAD cipher salt.Just noticed the most recent commit. I hoped https://github.com/shadowsocks/shadowsocks-crypto/commit/0185e54128a48c610521b50d854f5afb1ca58e42 would fix this, but it didn’t. Same crash in the same place.
For reference, the crash takes place in this loop: https://github.com/shadowsocks/shadowsocks-crypto/blob/0185e54128a48c610521b50d854f5afb1ca58e42/src/v1/cipher.rs#L153-L167 Specifically, the second iteration of the loop.
offsetis 16,key_lenis 32, and it dies duringm.finalize()on that iteration.