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

Most upvoted comments

  1. I think is the default way of building? Just cargo build --bin sslocal will do this, right? In that case, no effect
  2. No effect
  3. This has an effect: it will run until a request is made to the sslocal server. Then it will fail inside the creation of a new EncryptedWriter here: 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. offset is 16, key_len is 32, and it dies during m.finalize() on that iteration.