Skip to content

Named pipes broken under Wine #79

@kotauskas

Description

@kotauskas

Describe the bug
The crate's Windows named pipe support seems to be immensely broken under Wine, with oddities ranging from SetNamedPipeHandleState returning "invalid parameter" even when the pointee of mode passed to it is 2 (as per Wine sources that should be impossible), to FlushFileBuffers not providing the synchronization it is expected to.

To Reproduce
Run the test suite under Wine. Note that your Rust toolchain doesn't have to run under Wine, cross-compilation is as easy as adding the target in Rustup. Therefore, assuming binfmt_misc for Wine is correctly set up, the following commands are enough to start investigating:

rustup target add x86_64-pc-windows-gnu
cargo test --all-features --target=x86_64-pc-windows-gnu

Expected behavior
All tests pass.

Additional context
The most recent Wine version on which tests have been seen to fail is 9.22.

Since there are no known Windows-exclusive users of Interprocess, and given that the very objective of the crate is to facilitate portability, this is so low-priority that I will not be working on this. However, maintainers of Wine may find this to be of interest, and if Windows-only dependents of this crate do come to be for one reason or another, documenting this behavior now may later save someone a lot of trouble figuring out that this is the fault of Interprocess (and possibly Wine) and not of their code.

Further note to Wine folks and others interested in debugging this: the test suite is quite meticulous and aggressively parallel. Starting with commit 2f7538dd6cb3eb472dc9710d7e7d1ac6d88468e2, the environment variables INTERPROCESS_TEST_NUM_CLIENTS and INTERPROCESS_TEST_NUM_CONCURRENT_CLIENTS can be used to override the total number of clients and the maximum for the amount concurrently dispatched, respectively. Those default to 80 and 6 respectively; decreasing the former makes transient bugs more likely to slip through in exchange for much-reduced debugging noise during test failures, while decreasing the latter (typically to 1) may inhibit synchronization bugs, and is thus useful for quickly checking if a test failure only occurs under contention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions