Skip to content

Unbind fails in release mode on Windows using IPC transport #415

@mabartcz

Description

@mabartcz

Issue

When using the zmq crate (version 0.10.0) on Windows, calling unbind on an IPC socket works correctly in debug mode (cargo run) but fails in release mode (cargo run --release). The code panics with:

called `Result::unwrap()` on an `Err` value: No such file or directory

This seems to indicate that unbind cannot find the path, despite it being the exact same path used in the preceding bind call.

Platform

  • OS: Windows
  • Crate version: zmq = "0.10.0"
  • Rust: stable
  • Transport: IPC

Reproduction

fn main() {
    let context = zmq::Context::new();
    let socket_path = "ipc://test_soc";

    let responder = context.socket(zmq::REP).unwrap();
    responder.bind(socket_path).unwrap();
    
    responder.unbind(socket_path).unwrap(); // <- fails in release mode
}

Cargo.toml

[dependencies]
zmq = "0.10.0"

Steps to reproduce

  1. Run in debug mode (works fine):

    cargo run
    
  2. Run in release mode (fails):

    cargo run --release
    

Expected Behavior

unbind should succeed in release mode just like it does in debug mode, using the same code and socket path.

Additional Notes

  • This might relate to compiler optimizations, IPC path handling on Windows, or a race condition exposed only in release builds.
  • The behavior is consistent and reproducible.
  • If I try this with TCP, inproc, it works.
  • If I try this using C++, it works.

Please let me know if further diagnostics or logs are needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions