Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#905 closed bug (fixed)

the `impossible' happened: ASSERT failed! file codeGen/ClosureInfo.lhs, line 596

Reported by: Misha Aizatulin <avatar@…> Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.5
Keywords: Cc: avatar@…
Operating System: Linux Architecture: x86
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I was trying to compile ghc with profiling enabled: downloaded the source for ghc-6.4.2, configured it and created the following

avatar@avatar:~/tmp/ghc-6.4.2> cat mk/

SRC_HC_OPTS     = -H32m -O -fasm -Rghc-timing -prof -auto-all
GhcStage1HcOpts = -O0 -DDEBUG
GhcLibHcOpts    = -O -fgenerics
GhcLibWays      =
SplitObjs       = NO

Then said make in the top directory. During compilation the followinig error occured:

==fptools== make all -wr;
 in /home/avatar/tmp/ghc-6.4.2/libraries/base
../../ghc/compiler/ghc-inplace -H32m -O -fasm -Rghc-timing -prof -auto-all -fglasgow-exts -cpp -Iinclude -"#include" HsBase.h -funbox-strict-fields -ignore-package base -O -fgenerics  -fgenerics    -c Data/Dynamic.hs -o Data/Dynamic.o  -ohi Data/Dynamic.hi
ghc-6.4.2: panic! (the `impossible' happened, GHC version 6.4.2):
        ASSERT failed! file codeGen/ClosureInfo.lhs, line 596

Change History (5)

comment:1 Changed 10 years ago by guest

Cc: avatar@… added

comment:2 Changed 10 years ago by simonmar

This line:

SRC_HC_OPTS     = -H32m -O -fasm -Rghc-timing -prof -auto-all

will cause everything to be built with profiling: the stage 1 compiler, the libraries, the util programs (hsc2hs etc.) and the stage 2 compiler. I'd expect something to go wrong because GHC won't expect the "normal" libraries to be built for profiling.

Still, the crash is bad, so we should investigate at some point.

comment:3 Changed 10 years ago by Samuel Bronson <naesten@…>


This still happens with quasi-6.6 (calls itself 6.5...)...

Same file, same line number! The module being built is even the same module!

Also, it happens even when I only say:

WAY_p_HC_OPTS += -auto-all


SRC_HC_OPTS += -prof -auto-all

(I'm trying to track down increased allocation in some of the nofib programs caused by a patch I'm working on...)

Here is the relevant portion of my file (I left out the part for BuildFlavour = perf, since I'm not using it here.)

BuildFlavour = devel
#BuildFlavour = perf

# Which warnings we like to use
MyWarningOpts   = -W -fno-warn-unused-matches -fwarn-unused-imports

WAY_p_HC_OPTS += -auto-all #-caf-all

# -------- 1. A Development build --------------------------------------------

ifeq "$(BuildFlavour)" "devel"

GhcCompilerWays = 

SRC_HC_OPTS     = -H32m -O -fasm $(MyWarningOpts)
GhcLibHcOpts    = -O -dcore-lint $(MyWarningOpts)
GhcLibWays      = p

# If you're working on the stage1 compiler, build stage1 with debugging:
GhcStage1HcOpts = -Rghc-timing -O0 -DDEBUG

# alternatively, to work on the stage 2 compiler:
# GhcStage2HcOpts = -Rghc-timing -O0 -DDEBUG

# profiled RTS
#GhcRtsCcOpts =  -pg -g

# Optimised/profiled RTS
#GhcRtsCcOpts = -O2 -pg

#GhcRtsWithFrontPanel = YES
#SRC_HC_OPTS += `gtk-config --libs`

SplitObjs = NO

NoFibWays = p

ifeq "$(way)" "p"


comment:4 Changed 10 years ago by simonpj

Resolution: fixed
Status: newclosed

There was indeed a bug, which I have now fixed. Thanks


comment:5 Changed 10 years ago by simonpj

The Darcs patch is "Add the primitive type Any, and use it for Dynamics", incidentally

Note: See TracTickets for help on using tickets.