Trouble with waitpid and Rust

Michael Neumann mneumann at ntecs.de
Mon Jul 10 06:40:22 PDT 2017


Hi,

I am trying to port some Rust libraries to DragonFly, specifically the
[nix] crate to access UN*X APIs from Rust.

Some test cases randomly fail. Specifically one test case that uses
fork() and waitpid() is failing [2], where wait() returns ECHILD, i.e.
no child. When I execute the tests sequentially, everything is fine, but
when I run them in parallel, sometimes they hang.

I uploaded a gzipped binary to

	https://leaf.dragonflybsd.org/~mneumann/test-nix.gz

To run it:

	setenv RUST_BACKTRACE 1
	# sequential
	./test-nix --test-threads 1

	# parallel
	./test-nix --test-threads 10

	# Run only certain test cases
	./test-nix --test-threads 10 test_unistd

Any help appreciated.

Regards,

  Michael


[nix]: https://github.com/nix-rust/nix
[2]: https://github.com/nix-rust/nix/blob/master/test/test_unistd.rs#L45



More information about the Kernel mailing list