genprimopcode segfaulting in Gentoo ebuild

Simon Marlow
Fri, 23 Aug 2002 09:36:18 +0100

> I have just received a bug report for the Gentoo Linux ebuild of GHC
> 5.04 whose cause I cannot find. Recall that Gentoo builds all packages
> from sources.
> The build processes stops when genprimopcode segfaults during the last
> stage of the build (GHC 5.04 building itself).
> Anyone interested please look at
> for the complete Bugzilla entry which has all available details,
> including an strace of the segfaulting genprimopcode.

I'm afraid nothing springs to mind - but I do recall that genprimopcode
is perhaps the first Haskell binary to be executed in a bootstrapped
tree, so it could be just that the stage 2 compiler is building
consistently broken binaries.  That should be easy to verify.

The next stage is to try to debug it.  Compile up the runtime system (in
the compiler tree that is generating broken code) with the debugging
options (see mk/ for details).  Compile up something that
crashes, investigate with gdb, and we'll take it from there.