Ticket #5697 (closed bug: fixed)

Opened 6 months ago

Last modified 5 months ago

loadObj() fails with a Unicode file path on Windows

Reported by: guest Owned by: simonmar
Priority: high Milestone: 7.4.1
Component: GHCi Version: 7.0.4
Keywords: panic Cc:
Operating System: Windows Architecture: x86
Type of failure: Compile-time crash Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by simonpj) (diff)

>> cabal install vector

Loading package primitive-0.4.0.1 ... ghc.exe: panic! (the 'impossible' happened)
  (GHC version 7.0.3 for i386-unknown-mingw32):
        loadObj "C:\\Users\\Username\\AppData\\Roaming\\cabal\\primitive-0.4.0.1\\ghc-7.0.3\\HSprimitive-0.4.0.1.o": failed

on Windows 7. Other packages install properly.

Attachments

HSprimitive-0.4.0.1.o Download (140.6 KB) - added by guest 5 months ago.

Change History

Changed 6 months ago by guest

  • failure changed from Runtime crash to Compile-time crash

Changed 6 months ago by simonmar

  • status changed from new to closed
  • difficulty set to Unknown
  • version changed from 7.2.1 to 7.0.3
  • resolution set to worksforme

Works for me with 7.0.4 on Windows. Could you try a later version and reopen the ticket if you can still reproduce it?

Changed 6 months ago by guest

  • status changed from closed to new
  • resolution worksforme deleted
Loading package primitive-0.4.0.1 ... ghc.exe: panic! (the 'impossible' happened
)
  (GHC version 7.0.4 for i386-unknown-mingw32):
        loadObj "C:\\Users\\\1053\1077 \1047\1086\1103\\AppData\\Roaming\\cabal\
\primitive-0.4.0.1\\ghc-7.0.4\\HSprimitive-0.4.0.1.o": failed

Changed 6 months ago by guest

Just try

cabal install agda-executable

Changed 5 months ago by guest

Changed 5 months ago by simonmar

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

I successfully installed agda-executable, but looking at the second error message posted I think I see where the problem might be:

loadObj "C:\\Users\\\1053\1077 \1047\1086\1103\\AppData\\Roaming\\cabal\\primitive-0.4.0.1\\ghc-7.0.4\\HSprimitive-0.4.0.1.o": failed

It looks like your user name is made of Unicode, and we are probably not passing this filename correctly to loadObj.

Changed 5 months ago by simonmar

  • summary changed from primitive-0.4.0.1 panic to loadObj() fails with a Unicode file path on Windows

Changed 5 months ago by simonpj

  • owner set to simonmar
  • description modified (diff)

Changed 5 months ago by marlowsd@…

commit 81c69f305c79c181a2e15cf88615baa441dae755

Author: Simon Marlow <marlowsd@gmail.com>
Date:   Fri Jan 6 14:51:40 2012 +0000

    Make the RTS linker API use wide-char pathnames on Windows (#5697)
    
    I haven't been able to test whether this works or not due to #5754,
    but at least it doesn't appear to break anything.

 compiler/ghci/ObjLink.lhs |   38 ++++---------
 includes/rts/Linker.h     |   18 ++++--
 rts/Linker.c              |  136 +++++++++++++++++++++++++++-----------------
 rts/LinkerInternals.h     |    2 +-
 4 files changed, 107 insertions(+), 87 deletions(-)

Changed 5 months ago by guest

  • version changed from 7.0.3 to 7.0.4
  • os changed from Windows to Unknown/Multiple

just checked 7.0.4 with unicode path in linux - got same error like on windows, but not fatal: "кабал" in path was replaced by ":010;", so binaries got installed in another directory

please check your patch on linux too

Changed 5 months ago by guest

  • os changed from Unknown/Multiple to Windows

sorry, of course bug in prev post is not the same as #5697.

wine reports #5697 error as expected.

another bug is that in wine, windows and linux with 7.0.4

cabal changes unicode characters in install path to some other, probably ASCII, like in prev post.

possibly this is related with #5754

Changed 5 months ago by simonmar

  • status changed from new to merge
  • component changed from Compiler to GHCi

The bug in this ticket is now fixed. I've tested it by hand, but testing it automatically is ridiculously hard due to code page problems (see #5754) so I'm giving up.

Changed 5 months ago by igloo

  • status changed from merge to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.