[commit: testsuite] master: Fix T7160 segfault by importing debugBelch2 (73b3144)

Joey Adams <[email protected]> Mon, 31 Dec 2012 19:24:43 -0800
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/73b314432f9e062e9cf733a85b10f7efea52db20

>---------------------------------------------------------------

commit 73b314432f9e062e9cf733a85b10f7efea52db20
Author: Joey Adams <[email protected]>
Date:   Mon Dec 31 22:21:40 2012 -0500

    Fix T7160 segfault by importing debugBelch2

>---------------------------------------------------------------

 tests/rts/T7160.hs |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/rts/T7160.hs b/tests/rts/T7160.hs
index 8f5ef43..a92ae2c 100644
--- a/tests/rts/T7160.hs
+++ b/tests/rts/T7160.hs
@@ -3,9 +3,10 @@ import GHC.ForeignPtr
 import GHC.Ptr
 import System.Mem
 
--- one should really use own C function rather than this varargs one to avoid
--- possible ABI issues
-foreign import ccall "&debugBelch" fun :: FunPtr (Ptr () -> Ptr () -> IO ())
+-- Don't use debugBelch() directly, because we cannot call varargs functions
+-- using the FFI (doing so produces a segfault on 64-bit Linux, for example).
+-- See Debug.Trace.traceIO, which also uses debugBelch2.
+foreign import ccall "&debugBelch2" fun :: FunPtr (Ptr () -> Ptr () -> IO ())
 
 new name = do
     p <- newForeignPtr_ (Ptr name)