Ticket #4198 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

waitForProcess fails with "Bad file descriptor"

Reported by: yugr Owned by: simonmar
Priority: high Milestone: 7.0.1
Component: libraries/process Version: 6.12.3
Keywords: waitForProcess Cc:
Operating System: Windows Architecture: x86
Type of failure: Incorrect result at runtime Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

I am running this small sample program:

int main() { return -1; }

from this Haskell code (both from ghci and compiled):

import System.Process
main = system "a.exe" >> putStrLn "This is not printed"

and get this error

tmp.exe: waitForProcess: invalid argument (Bad file descriptor)

I guess there is a runtime error inside system-call which crashes execution.

I am on Windows 7, ghc 6.12.1. I tried both Cygwin g++ and MSVS cl C++ compilers.

One side question: is there any other way to run external program?

Attachments

tmp.cpp Download (26 bytes) - added by yugr 3 years ago.
tmp.hs Download (79 bytes) - added by yugr 3 years ago.

Change History

Changed 3 years ago by yugr

Changed 3 years ago by yugr

Changed 3 years ago by yugr

System.Process version 1.0.1.2

Changed 3 years ago by yugr

System.Cmd system also fails with same error.

Changed 3 years ago by simonmar

Did you compile with or without -threaded?

Changed 3 years ago by yugr

Without. Just standard ghc --make.

Changed 3 years ago by igloo

  • priority changed from normal to high
  • milestone set to 6.14.1

Changed 3 years ago by simonmar

  • owner set to simonmar

Changed 3 years ago by simonmar

  • status changed from new to closed
  • resolution set to fixed
  • architecture changed from x86_64 (amd64) to x86

Fixed;

Fri Aug 13 16:10:38 BST 2010  Simon Marlow <marlowsd@gmail.com>
  * Cope with an exit code of -1 (#4198)
Note: See TracTickets for help on using tickets.