Occasional segfault in GHCi w/ 7.4.1-rc1 and 64bit OS X

austin seipp as at hacks.yi.org
Sun Dec 25 06:35:05 CET 2011

Hello GHC hackers,

I have been trying the recent 7.4.1-rc1 release on my OSX Snow Leopard
machine. I am using the 64bit OSX .tar.bz. I used virthualenv/hsenv to
set up a virtual environment to test packages with the RC, but I
discovered that GHCi seems to segfault somewhat randomly when invoked.

I cannot reproduce this problem with 7.0.4 (64bit,) 7.2.2 (64bit,) or
7.5.20111223 (also 64bit.) I have invoked GHCi probably a hundred
times each, and have never had it crash. I can crash the RC fairly
reliably however.

I looked at the shell scripts that invoke GHC and ran GDB with the
proper arguments. I got a backtrace like so:

$ gdb /Users/a/vh-741-rc1_2/.hsenv/ghc/lib/ghc-
GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
shared libraries .... done

warning: Could not find object file
- no debug information available for "../src/x86/ffi64.c".

warning: Could not find object file
- no debug information available for "../src/prep_cif.c".

warning: Could not find object file
- no debug information available for "../src/types.c".

(gdb) r -B/Users/a/vh-741-rc1_2/.hsenv/ghc/lib/ghc- --interactive
Starting program:
Reading symbols for shared libraries + done
GHCi, version http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000ae21cf68
0x00000001ae2060da in evacuate1 ()
(gdb) bt
#0  0x00000001ae2060da in evacuate1 ()
#1  0x00000001ae20b868 in scavenge_block1 ()
Previous frame inner to this frame (gdb could not unwind past this frame)

So it looks like a GC bug at first glance, but I haven't done rigorous

Again this doesn't happen every time - probably 1/3 the time it
crashes, the other 2/3 the time it seems to work fine. This naturally
also affects `runghc`.

Is this a known issue? Or should I file a bug and investigate further?
Perhaps something forgot to get something merged into the 7.4 branch?


More information about the Glasgow-haskell-users mailing list