[GHC] #14334: Large static object : getLabelBc: Ran out of labels

#14334: Large static object : getLabelBc: Ran out of labels -------------------------------------+------------------------------------- Reporter: h4ck3rm1k3 | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: GHCi | Version: 8.0.2 Keywords: | Operating System: Unknown/Multiple Architecture: x86_64 | Type of failure: GHCi crash (amd64) | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- stack ghci The following GHC options are incompatible with GHCi and have not been passed to it: -threaded Configuring GHCi with the following packages: 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 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 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14334 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14334: Large static object : getLabelBc: Ran out of labels -------------------------------------+------------------------------------- Reporter: h4ck3rm1k3 | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 | (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by dfeuer: Old description:
stack ghci The following GHC options are incompatible with GHCi and have not been passed to it: -threaded Configuring GHCi with the following packages: 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
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
New description: {{{ stack ghci The following GHC options are incompatible with GHCi and have not been passed to it: -threaded Configuring GHCi with the following packages: 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 }}} 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 -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14334#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14334: Large static object : getLabelBc: Ran out of labels -------------------------------+-------------------------------------- Reporter: h4ck3rm1k3 | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Changes (by h4ck3rm1k3): * os: Unknown/Multiple => Linux -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14334#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14334: Large static object : getLabelBc: Ran out of labels -------------------------------+-------------------------------------- Reporter: h4ck3rm1k3 | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Comment (by h4ck3rm1k3): Reducing the size of the static data of course solves this problem. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14334#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14334: Large static object : getLabelBc: Ran out of labels -------------------------------+-------------------------------------- Reporter: h4ck3rm1k3 | Owner: (none) Type: bug | Status: infoneeded Priority: lowest | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Changes (by RyanGlScott): * status: new => infoneeded Comment: It's impossible for me to reproduce this at the moment, since this project relies on code that's [https://github.com/h4ck3rm1k3/gcc- haskell/blob/c4dcf67c73a974715d6368e234506e4df2ce749f/stack.yaml#L40 only available on your machine]. Posting a version of this code (preferably with no external dependencies) would go a long way in helping us diagnose the issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14334#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14334: Large static object : getLabelBc: Ran out of labels -------------------------------+-------------------------------------- Reporter: h4ck3rm1k3 | Owner: (none) Type: bug | Status: infoneeded Priority: lowest | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Comment (by h4ck3rm1k3): Sorry about that, I removed all local deps and cleaned up the code so that it compiles ok. Please check again. Sorry to waste your time. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14334#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14334: Large static object : getLabelBc: Ran out of labels -------------------------------+-------------------------------------- Reporter: h4ck3rm1k3 | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Changes (by RyanGlScott): * status: infoneeded => new Comment: Thanks, that was helpful. I'm now able to reduce this to a single (very large) file with only a `text` dependency (which is bundled with GHC HEAD nowadays), which can be found [https://gist.githubusercontent.com/RyanGlScott/75e8b0ad7a3995f6877e3e8e2f9a7... here] (since it exceeds Trac's file upload limit). Running `ghci` on this file is enough to make it panic: {{{ $ ~/Software/ghc2/inplace/bin/ghc-stage2 --interactive LibData.hs GHCi, version 8.3.20171004: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling LibData ( LibData.hs, interpreted ) ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.3.20171004 for x86_64-unknown-linux): getLabelBc: Ran out of labels }}} I've reproduced this with GHC 8.0.2, 8.2.1, and HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14334#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14334: Large static object : getLabelBc: Ran out of labels -------------------------------+-------------------------------------- Reporter: h4ck3rm1k3 | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Changes (by bgamari): * cc: Jaffacake (added) Comment: Hmm, this is a bit tricky; the trouble is the GHCi bytecode only has room for 16-bit labels. I suspect the most sensible option would be to break up large BCO objects during ByteCodeGen, but this sounds slightly non- trivial. Simon, any thoughts? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14334#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14334: Large static object : getLabelBc: Ran out of labels -------------------------------+-------------------------------------- Reporter: h4ck3rm1k3 | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Comment (by h4ck3rm1k3): Is there any workarounds ? Is this 16 bit per module or globally? How do you deal with large programs? Can i transform the data which is code into some other form to use less labels? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14334#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14334: Large static object : getLabelBc: Ran out of labels -------------------------------+-------------------------------------- Reporter: h4ck3rm1k3 | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Comment (by bgamari): I believe we pass Core to the byte-code generator as a whole module. I suspect breaking your list into multiple, moderately-sized modules would be one potential workaround. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14334#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14334: Large static object : getLabelBc: Ran out of labels -------------------------------+-------------------------------------- Reporter: h4ck3rm1k3 | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: GHCi | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Comment (by h4ck3rm1k3): Splitting this into two modules gave me a workaround for this issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14334#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC