Opened 5 years ago

Closed 5 years ago

#5921 closed bug (fixed)

Two GHC linkers running in parallel on Windows goes wrong

Reported by: NeilMitchell Owned by:
Priority: normal Milestone: 7.4.2
Component: Compiler Version: 7.4.1
Keywords: Cc: ndmitchell@…
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Running the attached script, I get one of three error messages (non-deterministically):

C:\ghc\ghc-7.4.1\lib/../mingw/bin/windres.exe: can't open file
`main.exe.manifest': No such file or directory

DeleteFile "main.exe.manifest": does not exist (The system cannot find the file specified.)

main.exe.manifest: openFile: permission denied (Permission denied)

The script attempts to run two linkers simultaneously. I have replicated this bug on two Windows machines, on both GHC 7.2.2 and 7.4.1.

Attachments (1)

Main.hs (559 bytes) - added by NeilMitchell 5 years ago.

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by NeilMitchell

Attachment: Main.hs added

comment:1 Changed 5 years ago by NeilMitchell

Cc: ndmitchell@… added

comment:2 Changed 5 years ago by simonmar

difficulty: Unknown

This is slightly amusing. It turns out the script has a bug: "-o2/Main.exe" is wrong, it should be "-o 2/Main.exe". Why isn't there an error about an unrecognised flag? Well, GHC passes anything that looks like a filename along to the linker, and it decided that "-o2/Main.exe" looked like a filename because it contains ".". You might expect gcc to complain about "-o2/Main.exe", but it appears to ignore it (it's probably a valid flag, I haven't trawled the gcc man page). The upshot is that the command appears to work, but produces "Main.exe" instead of "2/Main.exe".

I'll change GHC to not pass args beginning with "-" to the linker and emit an error instead.

comment:3 Changed 5 years ago by marlowsd@…

commit 93299cce9a4f7bc65b8164f779a37ef7f9f7c4a0

Author: Simon Marlow <>
Date:   Tue Mar 13 11:30:13 2012 +0000

    Tweak to flag parsing (#5921)
    -o2/Main.exe should be an invalid flag, not a linker input

 ghc/Main.hs |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

comment:4 Changed 5 years ago by simonmar

Milestone: 7.4.2
Status: newmerge

comment:5 Changed 5 years ago by pcapriotti

Resolution: fixed
Status: mergeclosed
Note: See TracTickets for help on using tickets.