Ticket #2794 (closed bug: wontfix)

Opened 5 years ago

Last modified 5 years ago

Bootstrapping ghc-6.4.3 hangs in call to "ghc-pkg-inplace"

Reported by: cspiel Owned by:
Priority: normal Milestone:
Component: Build System Version: 6.4.3
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

I want to bootstrap ghc-6.4.3 with ghc-6.2.2 on an i686 Linux system based on libc-2.2.4. The bootstrap make runs ok until the following command:

../utils/ghc-pkg/ghc-pkg-inplace --force --update-package <package.conf.inplace

which "hangs forever" while chewing up cpu cycles.

Cd-ing into ghc-pkg and issuing

./ghc-pkg.bin --help

produces exactly the same effect. An strace on the latter command results in an endless series of

sigreturn()                             = ? (mask now [])
--- SIGVTALRM (Virtual timer expired) ---

When running ghc-pkg.bin under the control of gdb and interrupting with C-c always catches the execution inside of

__stginit_DistributionziCompatziReadP_ ()

which is a part of Cabal. However, the following trivial test program does not get stuck in that call:

-- Compile with:
--   ghc -i../../lib/compat -L../../lib/compat -lghccompat \
--       -o use-readp use-readp.hs

import Distribution.Compat.ReadP

main :: IO ()
main = do
       putStr "start.\n"

I'm not familiar enough with the ghc build system (nor Haskell) to know what goes wrong here.

Change History

follow-up: ↓ 2   Changed 5 years ago by maeder

Is there no binary distribution of an even newer ghc version that works with libc-2.2.4? (I didn't find one under  http://haskell.org/ghc/dist/) Is your ghc-6.2.2 from  http://haskell.org/ghc/dist/6.2.2/ghc-6.2.2-i386-linux-glibc2.2.tar.bz2? I don't see a release of ghc-6.4.3. So try ghc-6.4.2

in reply to: ↑ 1   Changed 5 years ago by cspiel

Replying to maeder:

Is there no binary distribution of an even newer ghc version that works with libc-2.2.4? (I didn't find one under  http://haskell.org/ghc/dist/)

Sadly, I'm not aware of any newer distro. Libc-2.2 is ancient.

Is your ghc-6.2.2 from  http://haskell.org/ghc/dist/6.2.2/ghc-6.2.2-i386-linux-glibc2.2.tar.bz2?

Yes.

I don't see a release of ghc-6.4.3. So try ghc-6.4.2

Using ghc-6.4.2 on my system gives

ghc-6.4.2: /lib/libc.so.6: version `GLIBC_2.3' not found (required by ghc-6.4.2)
ghc-6.4.2: /lib/libpthread.so.0: version `GLIBC_2.3.2' not found (required by ghc-6.4.2)

as expected. :(

  Changed 5 years ago by maeder

Try building ghc-6.4.2 or ghc-6.6.1 from sources using ghc-6.2.2

follow-up: ↓ 5   Changed 5 years ago by simonmar

  • difficulty set to Unknown

I'm not sure we're going to be able to help much other than to give you some tips for debugging it. I'd start by disassembling stginit_DistributionziCompatziReadP_ and stepping forward in gdb to see why it's looping. Try compiling ghc-pkg or Distribution.Compat.ReadP with -fasm and see if that helps.

in reply to: ↑ 4   Changed 5 years ago by cspiel

Replying to simonmar:

Try compiling ghc-pkg or Distribution.Compat.ReadP with -fasm and see if that helps.

Compiling just ghc-pkg or just readp.hs, or both with option -fasm does not remove the problem. ghc-pkg still hangs.

Then I pulled out the big mallet and said

make clean
make EXTRA_HC_OPTS=-fasm

in the root directory. This makes the problem go away and the bootstraping run grinds on for a long long time (as it should be). However, after a while I run into

../compiler/ghc-inplace -H16m -O -optc-O2 -static -I/site/include -I. -#include HCIncludes.h -fvia-C -dcmm-lint   -#include posix/Itimer.h -fasm -c PrimOps.cmm -o PrimOps.o
ghc-6.6.1: panic! (the 'impossible' happened)
  (GHC version 6.6.1 for i386-unknown-linux):
        iselExpr64(i386) -_c23::I64

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

Following meader's advice I used ghc-6.6.1 for this run. ghc-6.4.3 faults at a different file:

../../ghc/compiler/ghc-inplace -H16m -O -O2 -static -I. -#include Prelude.h -#include Rts.h -#include RtsFlags.h -#include RtsUtils.h -#include StgRun.h -#include Schedule.h -#include Printer.h -#include Sanity.h -#include STM.h -#include Storage.h -#include SchedAPI.h -#include Timer.h -#include Itimer.h -#include ProfHeap.h -#include LdvProfile.h -#include Profiling.h -#include Apply.h -fvia-C -dcmm-lint    -fasm -c Apply.cmm -o Apply.o
ghc-6.4.3: panic! (the `impossible' happened, GHC version 6.4.3):
        nativeGen/RegisterAlloc.hs:286: Non-exhaustive patterns in function livenessSCCs

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

So, it looks like a clever use of "-fasm" could do the job: Get ghc-phk built with "-fasm" then interrupt and continue without the option. It won't be pretty, but I want a working Haskell compiler and not a beauty prize.

  Changed 5 years ago by simonmar

  • status changed from new to closed
  • resolution set to wontfix

Looks like you're running into old code gen bugs, perhaps coupled with some incompatibility with your gcc version. I think you're taking the right approach. Please continue the discussion on glasgow-haskell-users@…, and open a new ticket if you run into a bug which is likely to be still present or which we have a chance of reproducing.

Note: See TracTickets for help on using tickets.