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

Unix.system .exec Sys.command failures when threading fuctions are called #4725

Closed
vicuna opened this issue Feb 21, 2009 · 2 comments
Closed
Labels

Comments

@vicuna
Copy link

vicuna commented Feb 21, 2009

Original bug ID: 4725
Reporter: diloo
Status: closed (set by @xavierleroy on 2009-03-28T16:51:22Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.0
Category: ~DO NOT USE (was: OCaml general)
Related to: #4666
Monitored by: diloo @dbuenzli

Bug description

If I compile this short program :

let _ =
ignore (Thread.create (function () -> ();) ());
Unix.system "emacs";;

with the command
ocamlc -thread threads.cma unix.cma file.ml

Unix.system returns a WEXITED 127, if I replace Unix.system with Sys.command I get the same result.
Removing Thread.create solves the problem. It seems that I cannot execute programs in my caml code after having called a function of the Thread module.

I noticed that compiling with the -vmthread option makes it work, but I would like to use native threads.

Additional information

My config :

Mac OS X 10.5.6 up to date
OCaml 3.11.0
XCode 3.1.1

@vicuna
Copy link
Author

vicuna commented Feb 21, 2009

Comment author: @dbuenzli

Was able to reproduce with 10.5.6, ocaml 3.11.0 and xcode 3.1.2

Daniel

@vicuna
Copy link
Author

vicuna commented Mar 28, 2009

Comment author: @xavierleroy

This is probably an instance of Mac OS X's infamous limitation (cannot exec from a program that runs multiple threads, despite what the POSIX standard says), which became all the more apparent in 3.11.0 following another bug fix. (See #4666 for more details.)

The issue is already fixed on the "release311" branch. The fix will be in release 3.11.1.

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

No branches or pull requests

1 participant