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

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-7.4.0.20111219/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 "/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(ffi64.o)" - no debug information available for "../src/x86/ffi64.c". warning: Could not find object file "/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(prep_cif.o)" - no debug information available for "../src/prep_cif.c". warning: Could not find object file "/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(types.o)" - no debug information available for "../src/types.c". (gdb) r -B/Users/a/vh-741-rc1_2/.hsenv/ghc/lib/ghc-7.4.0.20111219 --interactive Starting program: /Users/a/vh-741-rc1_2/.hsenv/ghc/lib/ghc-7.4.0.20111219/ghc -B/Users/a/vh-741-rc1_2/.hsenv/ghc/lib/ghc-7.4.0.20111219 --interactive Reading symbols for shared libraries + done GHCi, version 7.4.0.20111219: 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) (gdb) So it looks like a GC bug at first glance, but I haven't done rigorous investigation. 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? -- Regards, Austin

On Sun, Dec 25, 2011 at 12:35 AM, austin seipp
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.
A data point: I've been testing out the RC, including minimal use of ghci, on a similar machine (same OS and arch). I've been using a 32-bit source build of RC and I haven't seen anything like this. Antoine

On Sun, Dec 25, 2011 at 00:35, austin seipp
I looked at the shell scripts that invoke GHC and ran GDB with the proper arguments. I got a backtrace like so:
I would not place much faith in this particular backtrace; gdb is badly broken on SL and Lion, it gets seriously mucked up by the way shared library stubs work (probably among other issues, but this one was easy to spot: just try to trace through such a call), and I get failures running stuff in gdb that do not happen outside of it. Backtraces from core files are okay, but running something inside gdb will often fail in quasi-random places. (there's a bug open in MacPorts about it. someone did manage to get the very latest gdb to work at one point, but both Apple's and MacPorts' gdbs are known to fail.) -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On Sat, Dec 24, 2011 at 9:35 PM, austin seipp
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 get this too, with the ghci-7.4.0.20111219 from GHC-7.4.0.20111219-x86_64.pkg on OS 10.6.8, and it happens about half of the time. It seems random when it segfaults and when it runs. I don't know if it's worth anything, but the gdb backtrace looks similar: (gdb) bt #0 0x00000001f6c930da in evacuate1 () #1 0x00000001f6c98868 in scavenge_block1 () Previous frame inner to this frame (gdb could not unwind past this frame) It's easy for me to repro at the moment, since I get it so frequently. I compiled a bunch of cabal packages just fine, so it seems to just be ghci and runghc.

of the time. It seems random when it segfaults and when it runs. I don't know if it's worth anything, but the gdb backtrace looks similar:
(gdb) bt #0 0x00000001f6c930da in evacuate1 () #1 0x00000001f6c98868 in scavenge_block1 () Previous frame inner to this frame (gdb could not unwind past this frame)
Oh, and I should say this is from a core dump, though there are a few suspicious errors starting up. And oddly I get more info from a bogus binary than the actual ghc binary: % gdb /Library/Frameworks/GHC.framework/Versions/7.4.0.20111219-x86_64/usr/lib/ghc-7.4.0.20111219/ghc /cores/core.67101 GNU gdb 6.3.50-20050815 (Apple version gdb-1510) (Wed Sep 22 02:45:02 UTC 2010) 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"...unable to read unknown load command 0x24 unable to read unknown load command 0x26 Reading symbols for shared libraries .... done unable to read unknown load command 0x24 unable to read unknown load command 0x26 warning: Could not find object file "/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(ffi64.o)" - no debug information available for "../src/x86/ffi64.c". warning: Could not find object file "/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(prep_cif.o)" - no debug information available for "../src/prep_cif.c". warning: Could not find object file "/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(types.o)" - no debug information available for "../src/types.c". Reading symbols for shared libraries . done unable to read unknown load command 0x24 unable to read unknown load command 0x26 Reading symbols for shared libraries .... done #0 0x00000001f6c930da in ?? () (gdb) bt #0 0x00000001f6c930da in ?? () (gdb) Versus a bogus binary: % gdb foo /cores/core.67101 GNU gdb 6.3.50-20050815 (Apple version gdb-1510) (Wed Sep 22 02:45:02 UTC 2010) 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"...foo: No such file or directory Reading symbols for shared libraries . done unable to read unknown load command 0x24 unable to read unknown load command 0x26 Reading symbols for shared libraries warning: Could not find object file "/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(ffi64.o)" - no debug information available for "../src/x86/ffi64.c". warning: Could not find object file "/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(prep_cif.o)" - no debug information available for "../src/prep_cif.c". warning: Could not find object file "/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(types.o)" - no debug information available for "../src/types.c". ..... done #0 0x00000001f6c930da in evacuate1 () (gdb) bt #0 0x00000001f6c930da in evacuate1 () #1 0x00000001f6c98868 in scavenge_block1 () Previous frame inner to this frame (gdb could not unwind past this frame) (gdb)

I'm still seeing this problem in 7.4.2. Is there a workaround?
I'm also on Snow Leopard and using 64-bit version.
Thanks,
Tony
On Sun, Dec 25, 2011 at 12:35 AM, austin seipp
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-7.4.0.20111219/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 "/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(ffi64.o)" - no debug information available for "../src/x86/ffi64.c".
warning: Could not find object file
"/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(prep_cif.o)" - no debug information available for "../src/prep_cif.c".
warning: Could not find object file "/Users/ian/zz64/ghc-7.4.0.20111219/rts/dist/build/libHSrts_thr.a(types.o)" - no debug information available for "../src/types.c".
(gdb) r -B/Users/a/vh-741-rc1_2/.hsenv/ghc/lib/ghc-7.4.0.20111219 --interactive Starting program: /Users/a/vh-741-rc1_2/.hsenv/ghc/lib/ghc-7.4.0.20111219/ghc -B/Users/a/vh-741-rc1_2/.hsenv/ghc/lib/ghc-7.4.0.20111219 --interactive Reading symbols for shared libraries + done GHCi, version 7.4.0.20111219: 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) (gdb)
So it looks like a GC bug at first glance, but I haven't done rigorous investigation.
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?
-- Regards, Austin
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On Mon, Jul 16, 2012 at 12:26 PM, Tony Hannan
I'm still seeing this problem in 7.4.2. Is there a workaround? I'm also on Snow Leopard and using 64-bit version.
If you grabbed the installer from http://www.haskell.org/ghc/download_ghc_7_4_2 you'll need to build your own locally... the notes on the website say it's for 10.7/Lion and while it seems to work just fine on Lion it crashes frequently enough to be unusable on Snow Leopard. This gave me a bit of grief as well. -n

I actually made builds of GHC 7.4.1 with Snow Leopard that fixed this
issue back when I had it:
http://code.haskell.org/~thoughtpolice/ghc-741-osx-sl/
I must have forgotten to email the list. I have since upgraded to Lion
however. The builds are 64bit only as well. But that should be an easy
means of getting bootstrapped.
Apologies for dropping off on this one.
On Mon, Jul 16, 2012 at 5:21 PM, Nathan Howell
On Mon, Jul 16, 2012 at 12:26 PM, Tony Hannan
wrote: I'm still seeing this problem in 7.4.2. Is there a workaround? I'm also on Snow Leopard and using 64-bit version.
If you grabbed the installer from http://www.haskell.org/ghc/download_ghc_7_4_2 you'll need to build your own locally... the notes on the website say it's for 10.7/Lion and while it seems to work just fine on Lion it crashes frequently enough to be unusable on Snow Leopard. This gave me a bit of grief as well.
-n
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- Regards, Austin

Thanks. Building from source fixed it.
On Mon, Jul 16, 2012 at 7:46 PM, Austin Seipp
I actually made builds of GHC 7.4.1 with Snow Leopard that fixed this issue back when I had it:
http://code.haskell.org/~thoughtpolice/ghc-741-osx-sl/
I must have forgotten to email the list. I have since upgraded to Lion however. The builds are 64bit only as well. But that should be an easy means of getting bootstrapped.
Apologies for dropping off on this one.
On Mon, Jul 16, 2012 at 5:21 PM, Nathan Howell
wrote: On Mon, Jul 16, 2012 at 12:26 PM, Tony Hannan
wrote: I'm still seeing this problem in 7.4.2. Is there a workaround? I'm also on Snow Leopard and using 64-bit version.
If you grabbed the installer from http://www.haskell.org/ghc/download_ghc_7_4_2 you'll need to build your own locally... the notes on the website say it's for 10.7/Lion and while it seems to work just fine on Lion it crashes frequently enough to be unusable on Snow Leopard. This gave me a bit of grief as well.
-n
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- Regards, Austin
participants (7)
-
Antoine Latter
-
austin seipp
-
Austin Seipp
-
Brandon Allbery
-
Evan Laforge
-
Nathan Howell
-
Tony Hannan