Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testsuite/tests/lib-threads/pr5325.ml raises exception on Unix.shutdown #7367

Closed
vicuna opened this issue Sep 22, 2016 · 1 comment
Closed

Comments

@vicuna
Copy link

vicuna commented Sep 22, 2016

Original bug ID: 7367
Reporter: pmetras
Status: resolved (set by @xavierleroy on 2017-02-16T08:11:09Z)
Resolution: not a bug
Priority: normal
Severity: minor
Platform: i386
OS: Minix3
OS Version: 3.4.0
Category: standard library
Monitored by: @gasche

Bug description

For test testsuite/tests/lib-threads/pr5325.ml, the problem occurs with the call "Unix.shutdown s Unix.SHUTDOWN_SEND". I was unable to issue a shutdown command on Minix3 from OCaml. I've read the code multiple times and I don't understand why it does not work. Calling shutdown() from C code is working correctly, according to /usr/tests/minix-posix/test56 from Minix3 test suite.

The compilation command used by the test is "../byterun/ocamlrun ../ocamlc -g -nostdlib -I ../stdlib -w a -vmthread -I ../otherlibs/threads -I ../otherlibs/unix unix.cma threads.cma tests/lib-threads/pr5325.ml -o program"

It raises a Unix.Unix_error when run with "../byterun/ocamlrun -b ./program"
Fatal error: exception Unix.Unix_error(2, "shutdown", "")
Raised by primitive operation at unknown location (inlined)
Called from file "pr5325.ml", line 63, characters 2-31

If the call to Unix.shutdown is removed, the test succeeds, but that's not game.

@vicuna
Copy link
Author

vicuna commented Feb 16, 2017

Comment author: @xavierleroy

This seems to be a Minix3 bug in their implementation of shutdown(). OCaml's Unix.shutdown works fine under Linux, OS X, various BSDs, Cygwin, and Win32/Winsock, so it is quite unlikely the bug is on OCaml's side.

Please reopen this PR if you have evidence of the problem on any platform other than Minix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant