Ticket #789 (new bug)

Opened 3 years ago

Last modified 2 months ago

BCOs can only have 64k instructions

Reported by: simonpj Assigned to:
Priority: normal Milestone: 6.10 branch
Component: GHCi Version: 6.8.2
Severity: normal Keywords: BCO
Cc: Difficulty: Unknown
Test Case: Operating System: Linux
Architecture: x86

Description

Fredrick Eaton (frederik@a5.repetae.net) said:

Here I'm reading a very large matrix from a file and turning it into a template Haskell expression. Probably not the most efficient thing to do, but the error message could be clearer...

*Main> let y = $(qFast (\f -> runIO $ readMatrixFile "data.txt" (runQ.f)));
ghc-6.4.2: panic! (the `impossible' happened, GHC version 6.4.2):
        linkBCO: >= 64k insns in BCO

Indeed, the error message is unhelpful.

Attachments

Bug.hs (51.0 kB) - added by dbueno on 03/08/08 08:43:44.
Triggers linkBCO: >= 64k insns in BCO
testbco.hs (61.4 kB) - added by bboissin on 05/18/08 09:36:01.
triggers linkBCO: >= 64k insns in BCO

Change History

06/06/06 02:25:03 changed by simonpj

  • component changed from Compiler to GHCi.

10/20/06 07:18:44 changed by igloo

  • testcase changed.
  • owner set to igloo.
  • milestone set to 6.6.1.

I'm going to investigate the performance implications of using a high bit of the bytecode instructions for a "large (word-sized) arguments" flag.

See also 455.

12/24/06 07:10:48 changed by igloo

Two test cases that go wrong:

$ ghci -v0 -fth
Prelude> :m + Language.Haskell.TH
Prelude Language.Haskell.TH> let x = $( listE $ map (litE . integerL) [1..10000] )
ghc-6.7: panic! (the 'impossible' happened)
  (GHC version 6.7 for i386-unknown-linux):
        linkBCO: >= 64k insns in BCO

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
$ ghci -v0 -fth
Prelude> :m + Language.Haskell.TH
Prelude Language.Haskell.TH> let x = $( listE $ map (litE . integerL) [1..100000] )
ghc-6.7: panic! (the 'impossible' happened)
  (GHC version 6.7 for i386-unknown-linux):
        mkProtoBCO: stack use won't fit in 16 bits 600008

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

12/24/06 07:54:32 changed by igloo

Ooops, I already fixed the second test case above, of course.

03/27/07 16:48:43 changed by igloo

  • priority changed from low to normal.
  • milestone changed from 6.6.1 to 6.8.

Punting on this

08/06/07 11:31:16 changed by SamB

Couldn't you just chain BCOs together or something?

Also see #1552 -- I seem to have accidentally made a duplicate of this bug (and #455).

11/12/07 06:26:38 changed by simonmar

  • owner deleted.
  • milestone changed from 6.8 branch to _|_.

Not many people run into this one.

12/17/07 01:08:17 changed by simonpj

See also #1983

01/17/08 14:58:35 changed by jsnx

  • keywords set to BCO.
  • version changed from 6.4.2 to 6.8.2.
  • os changed from Unknown to Linux.
  • architecture changed from Unknown to x86.

I try to build a Chinese dictionary with ~10000 entries in it, as a

Data.Map.Map Char [([Char], [Char])]

and when I try to load this module in GHCi, I get

ghc-6.8.2: panic! (the 'impossible' happened)

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

linkBCO: >= 64k insns in BCO

That's okay -- I guess I could just put the dictionary in SQLite -- but it'd be cool if I could make huge Haskell data structures statically or something.

01/17/08 15:13:44 changed by dons

You'll get further here if you use a Map of ByteStrings?. The bytestring literals will be unpacked at compile time, and the linker should then be able to handle them better.

Using overloaded strings, you can even avoid having to insert 'pack' to build the bytestrings. see for example, this large static data, full of bytestrings,

http://code.haskell.org/~dons/code/pcre-light/tests/Unit.hs

03/08/08 08:43:44 changed by dbueno

  • attachment Bug.hs added.

Triggers linkBCO: >= 64k insns in BCO

03/08/08 08:45:30 changed by dbueno

I've added an attachment of a test case that triggers this error. The error specifically is:

ghc-6.8.2: panic! (the 'impossible' happened)

(GHC version 6.8.2 for i386-apple-darwin):

linkBCO: >= 64k insns in BCO

Since this error happens on Linux too, I won't change the Operating System; but I just want to point out this happens on Mac OS X too.

05/18/08 09:36:01 changed by bboissin

  • attachment testbco.hs added.

triggers linkBCO: >= 64k insns in BCO

05/18/08 09:40:09 changed by bboissin

testbco.hs makes the panic triggers with GHC version 6.8.2 for i386-unknown-linux. It is a regression since it was working fine with previous versions (I believe GHC 6.6 from ubuntu gutsy and feisty).

what I was doing is probably dumb but it was working fine for me :) (I was learning haskell playing with project euler and wasn't yet into monads, so the fastest way for me was to put the data with the code instead of loading a file).

08/12/08 06:38:17 changed by simonmar

See also #2504, with an example program

09/15/08 00:54:06 changed by simonmar

See #2590

09/15/08 00:54:57 changed by simonmar

  • milestone changed from _|_ to 6.10 branch.

People are bumping into this, let's move it into a milestone where it should get looked at.

09/25/08 13:29:03 changed by guest

I'm seeing this message when trying to load an Alex-generated lexer into GHCi. It works for normal compilation with GHC though.

09/25/08 13:44:45 changed by guest

BTW. using "alex -g" is a workaround (not for this bug, but for everyone running into it via alex).