Ticket #5921 (closed bug: fixed)

Opened 15 months ago

Last modified 14 months ago

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 Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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

Main.hs Download (0.5 KB) - added by NeilMitchell 15 months ago.

Change History

Changed 15 months ago by NeilMitchell

Changed 15 months ago by NeilMitchell

  • cc ndmitchell@… added

Changed 14 months ago by simonmar

  • difficulty set to 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.

Changed 14 months ago by marlowsd@…

commit 93299cce9a4f7bc65b8164f779a37ef7f9f7c4a0

Author: Simon Marlow <marlowsd@gmail.com>
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(-)

Changed 14 months ago by simonmar

  • status changed from new to merge
  • milestone set to 7.4.2

Changed 14 months ago by pcapriotti

  • status changed from merge to closed
  • resolution set to fixed

Merged as 00ae9a91b82de53a22bd55fe026f42842a3713a0.

Note: See TracTickets for help on using tickets.