Opened 6 years ago

Closed 3 years ago

#3828 closed bug (wontfix)

Error in array index

Reported by: CBa Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.12.2
Keywords: sunos Cc: guest
Operating System: Solaris Architecture: sparc
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description (last modified by igloo)

I simply compile ghc-6.12.1 on solaris with ghc 6.8.3.

when compiling libraries/ghc-prim/./GHC/Types.hs:

ghc-stage1: panic! (the 'impossible' happened)
  (GHC version 6.12.1 for sparc-sun-solaris2):
	Error in array index

Change History (12)

comment:1 Changed 6 years ago by simonpj

Did you remove every single M.hi file lying around; ie started in a clean tree? This kind of thing can happy when the binary format changes. (Later GHCs are more robust.)

S

comment:2 Changed 6 years ago by CBa

I stopped only once after configure & make to fix mkDerivedConstants.c (there is another ticket). Ticket #3827 reports exactly the same error on linux/powerpc.

comment:3 Changed 5 years ago by igloo

  • Description modified (diff)

comment:4 Changed 5 years ago by igloo

  • Milestone set to _|_

See also #3695. It's a little suspicious that the same failure happens on 2 platforms, but as they are both tier 2 we really need someone else, with better access to one of the platforms, to look into the problem.

Incidentally, it's probably easier to run the testsuite with stage1 and see if there is a small failing test, rather than trying to debug GHC itself.

comment:5 follow-up: Changed 5 years ago by simonpj

Make sure there are no old .hi files lying around, or start in a completely clean tree. GHC 6.8 gave this kind of error if it found a .hi file written by a different version of GHC. (Since improved.)

Simon

comment:6 in reply to: ↑ 5 Changed 5 years ago by simonmar

Replying to simonpj:

GHC 6.8 gave this kind of error if it found a .hi file written by a different version of GHC. (Since improved.)

I don't think that's it - here's the code that checks hi file versions in GHC 6.8:

  let our_ver = show opt_HiVersion
  when (check_ver /= our_ver) $
        -- This will be caught by readIface which will emit an error
        -- msg containing the iface module name.
    throwDyn (ProgramError (
        "mismatched interface file versions: expected "
        ++ our_ver ++ ", found " ++ check_ver))

In fact, GHC has checked hi file versions since 6.4.

comment:7 follow-up: Changed 5 years ago by guest

  • Cc guest added
  • Status changed from new to infoneeded
  • Version changed from 6.12.1 to 6.12.2

I have the same issue compiling GHC 6.12.2 on Sparc/Solaris10 (bootstrapping with GHC 6.8.2). Is there already a solution or workaround I can apply ?

comment:8 in reply to: ↑ 7 Changed 5 years ago by simonmar

Replying to guest:

I have the same issue compiling GHC 6.12.2 on Sparc/Solaris10 (bootstrapping with GHC 6.8.2). Is there already a solution or workaround I can apply ?

We don't know what's causing this error. It apparently happens when compiling 6.12.x with 6.8.x on powerpc/Linux (#3828) and Sparc/Solaris. I suspect a bug in 6.8.x on these platforms that has caused it to miscompile the stage 1 compiler, but that's just a theory. Someone needs to investigate further.

comment:9 Changed 5 years ago by benl

Are you sure you need to compile it with 6.8.2?

There's a binary distro for 6.12.1 on SPARC/Solaris here: http://haskell.org/ghc/dist/6.12.1/benl/ghc-6.12.1-sparc-sun-solaris2-fixed.tar.bz2

comment:10 Changed 5 years ago by igloo

  • Status changed from infoneeded to new

If this only happens with 6.8, and not 6.10, then there isn't much point in investigating it as

  • it's probably a bug in the no-longer-supported 6.8 branch
  • it can be worked around by going via 6.10, or a 6.12 binary
  • you won't be able to build 6.14 with 6.8 anyway, so it will be a moot point reasonably soon

comment:11 Changed 5 years ago by simonmar

Right, we just need to establish whether it really is a 6.8 bug, I don't think we have conclusive evidence of that yet.

comment:12 Changed 3 years ago by monoidal

  • Resolution set to wontfix
  • Status changed from new to closed

Closing - the bug concerns very old GHC and is most probably irrelevant now. If it is replicated in new versions, please create a new ticket.

Note: See TracTickets for help on using tickets.