Ticket #7314 (closed bug: worksforme)

Opened 8 months ago

Last modified 6 months ago

GHCi 64-bit OS X segfaults on interaction with C-libraries

Reported by: darchon Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.1
Keywords: GHCi external library 64-bit gloss Cc: george.colpitts@…
Operating System: MacOS X Architecture: x86_64 (amd64)
Type of failure: GHCi crash Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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:

OS X 10.8 (gcc 4.2.1, clang 4.0):
- 32-bit: interpreted and compiled work correctly
- 64-bit: only compiled code works correctly, interpreted code segfaults (11)

OS X 10.6 (gcc 4.2.1, XCode 3.2.6):
- 32-bit: interpreted and compiled code work correctly
- 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:
 http://thread.gmane.org/gmane.comp.lang.haskell.cafe/100652

Change History

Changed 7 months ago by george.colpitts

email thread mentions

>My only problem is that I don't have OS X 10.8 installed on my machine.
> I'm running OS X 10.6, and am not inclined to upgrade.
> So providing feedback on the questions related to the bug report will be hard and/or take some time.

I'm on 10.8 so I can answer any questions about the bug there. I think this is an important bug to fix as I have also seen it wrt Yale Euterpea project. A lot of courses teaching Haskell like to use graphics or audio for their examples, problems etc. so I think this is an important bug to fix.

Changed 7 months ago by george.colpitts

  • keywords gloss added

Changed 7 months ago by george.colpitts

also fails in 7.4.2 rc2, HP 2012.4.0.0

Changed 7 months ago by george.colpitts

  • cc george.colpitts@… added

Changed 6 months ago by darchon

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

I've installed GHC 7.6.1 and can no longer duplicate the described behaviour.

Note: See TracTickets for help on using tickets.