Ticket #3385 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

Compiling readline 1.0.1.0 on GHC 6.10.3 causes panic

Reported by: gparent Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.10.3
Keywords: readline panic truncated Cc:
Operating System: Linux Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Compiling readline 1.0.1.0 from source using GHC 6.10.3 causes the following output:

geordi@debianserv:~/haskell/readline-1.0.1.0$ runhaskell Setup.hs configure

Setup.hs:3:0:

Warning: In the use of `defaultUserHooks'

(imported from Distribution.Simple): Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2 compatibility in which case you must stick with defaultUserHooks"

Warning: defaultUserHooks in Setup script is deprecated. Configuring readline-1.0.1.0... checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for GNUreadline.framework... checking for readline... no checking for tputs in -lncurses... yes checking for readline in -lreadline... yes checking for rl_readline_version... yes checking for rl_begin_undo_group... yes checking for rl_erase_empty_line... yes checking for rl_free_undo_list... yes checking for rl_completion_word_break_hook in -lreadline... yes configure: creating ./config.status config.status: creating config.mk config.status: creating readline.buildinfo config.status: creating include/HsReadlineConfig.h config.status: include/HsReadlineConfig.h is unchanged geordi@debianserv:~/haskell/readline-1.0.1.0$ runhaskell Setup.hs build

Setup.hs:3:0:

Warning: In the use of `defaultUserHooks'

(imported from Distribution.Simple): Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2 compatibility in which case you must stick with defaultUserHooks"

Preprocessing library readline-1.0.1.0... Building readline-1.0.1.0... Binary: Int64 truncated to fit in 32 bit Int ghc: panic! (the 'impossible' happened)

(GHC version 6.10.3 for i386-unknown-linux):

Prelude.chr: bad argument

Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug

geordi@debianserv:~/haskell/readline-1.0.1.0$

Package was downloaded from:  http://hackage.haskell.org/cgi-bin/hackage-scripts/package/readline

GHC is the latest version from Debian/Unstable.

Change History

  Changed 4 years ago by pejo

GHC can give the chr: bad arugment-panic if you have .hi-files that were built with a different compiler laying around. Try removing any old .hi-files and rebuild.

  Changed 4 years ago by simonpj

  • difficulty set to Unknown

I've added this to the building FAQ:  http://hackage.haskell.org/trac/ghc/wiki/Building/Troubleshooting

Please close the bug if that fixes the problem.

Simon

follow-up: ↓ 4   Changed 4 years ago by simonmar

Remember the hi-file problem only affects people building GHC HEAD from source. The reporter said he was using GHC 6.10.3.

I wonder if perhaps he switched from 64-bit to 32-bit, or vice versa? I don't think we record the platform in the hi file, only the GHC version.

in reply to: ↑ 3   Changed 4 years ago by gparent

  • status changed from new to closed
  • resolution set to invalid

Replying to simonmar:

Remember the hi-file problem only affects people building GHC HEAD from source. The reporter said he was using GHC 6.10.3. I wonder if perhaps he switched from 64-bit to 32-bit, or vice versa? I don't think we record the platform in the hi file, only the GHC version.

No, I did not. The problem was indeed existing .hi files in the dist directory of the readline package I downloaded. Thanks everyone!

  Changed 4 years ago by simonmar

  • status changed from closed to reopened
  • resolution invalid deleted

I downloaded the readline package from that URL, and it doesn't seem to have any .hi files. Could you let me have a copy of the one you downloaded? (attaching it here is fine).

I'm interested in exactly what happened. I suspect the .hi files are from a different platform (Linux 64-bit probably), but the same GHC version. We ought to be putting the platform name in the .hi files too.

follow-up: ↓ 7   Changed 4 years ago by gparent

I'm sorry, I didn't phrase this correctly. The .hi files weren't in the package I downloaded, they were remnants from an earlier compile of the package that I did myself.

So what happened is, I compiled readline-1.0.1.0 for version god-knows-what, and then I tried rebuilding it with a newer GHC version, without cleaning, and I ran into those .hi related errors. No 64-bit involved in the entire process. Just different GHC versions after a package upgrade. runhaskell Setup.hs clean (or if that doesn't work, rm -rf dist), then rebuilding, fixed the problem.

in reply to: ↑ 6   Changed 4 years ago by simonmar

  • status changed from reopened to closed
  • resolution set to invalid

Replying to gparent:

I'm sorry, I didn't phrase this correctly. The .hi files weren't in the package I downloaded, they were remnants from an earlier compile of the package that I did myself. So what happened is, I compiled readline-1.0.1.0 for version god-knows-what, and then I tried rebuilding it with a newer GHC version, without cleaning, and I ran into those .hi related errors. No 64-bit involved in the entire process. Just different GHC versions after a package upgrade. runhaskell Setup.hs clean (or if that doesn't work, rm -rf dist), then rebuilding, fixed the problem.

Ok, then I'm still slightly mystified, as GHC should have detected that the old .hi files were from a different GHC version and emitted a suitable error message. Well, in the absence of any evidence we'll have to leave this one closed.

Note: See TracTickets for help on using tickets.