Search code examples
haskellghci

How to best workaround Haskell 8.03 GHCI getLabelBc: Ran out of labels?


What is the cause of this error and how can I get around it? I have reduced the size of the static data as a workaround but is there any way to create static data in haskell that does not run into this error? Basically I want to create large lists of objects that are compiled in and not loaded from file.

Reported here https://ghc.haskell.org/trac/ghc/ticket/14334

Compiling this project file here that is basically a large data object emitted from the rdf4h lib. I wanted to put the data into static space to improve load times and remove IO.

https://github.com/h4ck3rm1k3/gcc-haskell/blob/master/src/LibData.hs

stack ghci

gcc-haskell Using main module: 1. Package `gcc-haskell' component exe:gcc-haskell-exe with main-is file: /home/mdupont/experiments/g\ cc-haskell/gcc-haskell/app/Main.hs GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help [1 of 3] Compiling LibData ( LibData.hs, interpreted ) ghc: panic! (the 'impossible' happened)

(GHC version 8.0.2 for x86_64-unknown-linux):

getLabelBc: Ran out of labels

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

Solution

  • According to the development team (see bug report https://ghc.haskell.org/trac/ghc/ticket/14334#comment:8) the issue is due to 16 bit label addresses on the module level, the workaround is to split up the code into multiple modules.