[GHC] #4110: hsc2hs gives bad error message when it cannot execute the generated program

GHC cvs-ghc at haskell.org
Mon May 31 14:32:11 EDT 2010


#4110: hsc2hs gives bad error message when it cannot execute the generated program
---------------------------------+------------------------------------------
    Reporter:  duncan            |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  hsc2hs      
     Version:  6.12.2            |    Keywords:              
          Os:  Unknown/Multiple  |    Testcase:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 hsc2hs compiles a C program and then executes it. One of the failure modes
 is that the executable program can fail to run because the filesystem is
 mounted "noexec".

 The error message when it fails to execute the generated program is not
 ideal:

 {{{
 cabal install unix-compat
 Resolving dependencies...
 Configuring unix-compat-0.1.2.1...
 Preprocessing library unix-compat-0.1.2.1...
 running dist/build/System/PosixCompat/Extensions_hsc_make failed
 command was: dist/build/System/PosixCompat/Extensions_hsc_make
 >dist/build/System/PosixCompat/Extensions.hs
 cabal: Error: some packages failed to install:
 unix-compat-0.1.2.1 failed during the building phase. The exception was:
 ExitFailure 1
 }}}

 It requires a fair bit of guesswork to discover that the problem is that
 `/tmp` is mounted "noexec".

 This is a case where we want the System.Process to give us a permission
 exception rather than having the process terminate with an exit code that
 we do not know how to interpret. The tricky bit is that while the
 underlying C `execve` does give us a C error code, we've already forked by
 that time so it is tricky to return the error to the parent.

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


More information about the Glasgow-haskell-bugs mailing list