id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
7314	GHCi 64-bit OS X segfaults on interaction with C-libraries	darchon		"I'm experiencing spurious behaviour (segfaults sometimes) using GHCi when working with code that interacts with C-libraries. It seems to be an OS X only bug.

The spurious behaviour is as follows:[[BR]][[BR]]
OS X 10.8 (gcc 4.2.1, clang 4.0):[[BR]]
- 32-bit: interpreted and compiled work correctly[[BR]]
- 64-bit: only compiled code works correctly, interpreted code segfaults (11)

OS X 10.6 (gcc 4.2.1, XCode 3.2.6):[[BR]]
- 32-bit: interpreted and compiled code work correctly[[BR]]
- 64-bit: interpreted and compiled code work correctly

Additionally (OS X 10.8):
When I run 'ghci' from inside 'gdb' (to find the origin for the segfault), everything works fine (e.g. _no_ segfault).

Here is a link to the crash report given by OS X: http://pastebin.com/jZjfFtm7

And this is the test case:
{{{
cabal install gloss --flags""-GLUT GLFW""
cabal unpack gloss-examples
cd <unpacked-dir>/picture/GameEvent
ghci -fno-ghci-sandbox Main.hs
main
}}}

I'm filing this bug report in relation to the following thread on haskell-cafe, which is about removing the 32-bit recommendation for Haskell Platform on OS X:[[BR]]
http://thread.gmane.org/gmane.comp.lang.haskell.cafe/100652"	bug	closed	normal		Compiler	7.4.1	worksforme	GHCi external library 64-bit gloss	george.colpitts@…	MacOS X	x86_64 (amd64)	GHCi crash					
