[GHC] #15108: Panic: collectNBinders
GHC
ghc-devs at haskell.org
Tue May 1 02:19:18 UTC 2018
#15108: Panic: collectNBinders
-------------------------------------+-------------------------------------
Reporter: cdisselkoen | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Profiling | Version: 8.4.2
Resolution: | Keywords: panic
| collectNBinders
Operating System: Linux | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by nomeata):
Thanks for the nice test case, I added it to the test suite.
JFTR, this can be easily reproduced without stack or GHC:
{{{
~/build/haskell/ghc-master $ ./inplace/bin/ghc-stage2
testsuite/tests/profiling/should_compile/T15108.hs -prof -fprof-auto
-dcore-lint
[1 of 1] Compiling Main (
testsuite/tests/profiling/should_compile/T15108.hs,
testsuite/tests/profiling/should_compile/T15108.o )
*** Core Lint errors : in result of Desugar (after optimization) ***
testsuite/tests/profiling/should_compile/T15108.hs:22:7: warning:
[RHS of myInt_aVZ :: Int -> MyInt]
Join point has too few lambdas
Join var: myInt_aVZ
Join arity: 1
Number of lambdas: 0
Rhs = scctick<getInt.myInt> MyInt
*** Offending Program ***
getInt :: Shape -> MyInt
[LclIdX]
getIntghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.5.20180410 for x86_64-unknown-linux):
collectNBinders
1
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1162:37 in
ghc:Outputable
pprPanic, called at compiler/coreSyn/CoreSyn.hs:2056:25 in
ghc:CoreSyn
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
}}}
As you can see, it does not require any optimization level, and the bug is
in place right after the desugarer.
Maybe the optimizer copies the join arity from `MyInt` to `myInt`, under
the assumption that `myInt` will be inlined, but the `scctick` prevents
that from happening?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15108#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list