#5319: MacOS X + executeFile + -threaded = "Operation not supported"
---------------------------------+------------------------------------------
    Reporter:  PHO               |       Owner:                             
        Type:  bug               |      Status:  new                        
    Priority:  normal            |   Component:  libraries/unix             
     Version:  7.0.3             |    Keywords:  thread, exec               
    Testcase:                    |   Blockedby:                             
          Os:  MacOS X           |    Blocking:                             
Architecture:  Unknown/Multiple  |     Failure:  Incorrect result at runtime
---------------------------------+------------------------------------------
 http://uninformed.org/index.cgi?v=1&a=1&p=16
 http://lists.apple.com/archives/cocoa-dev/2005/Oct/msg00836.html

 Mac OS X has an undocumented behavior concerning 'execve(2)' inside a
 threaded process. If a process tries to call 'execve(2)' and has more
 than one native thread, the kernel returns 'EOPNOTSUPP'. This prevents
 'executeFile' from working when the threaded runtime is used.

 {{{
 % ghci
 GHCi, version 7.0.3: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Loading package ffi-1.0 ... linking ... done.
 Prelude> System.Posix.Process.executeFile "/bin/sh" False [] Nothing
 Loading package unix-2.4.2.0 ... linking ... done.
 *** Exception: /bin/sh: executeFile: failed (Operation not supported)
 Prelude>
 Leaving GHCi.
 % uname
 Darwin
 }}}

 To work around this, we have to 'fork(2)' before calling 'execve(2)',
 to make sure there is only a single active thread.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5319>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to