patch applied (testsuite): Fix #5003, test 4038 (ghci) fails on OS X 64 bit.

Ian Lynagh igloo at earth.li
Thu Mar 24 19:43:14 CET 2011


Thu Mar 24 10:07:05 PDT 2011  gwright at antiope.com
  * Fix #5003, test 4038 (ghci) fails on OS X 64 bit.
  
  The underlying problem in ticket #5003 is not in ghc, but rather
  that the test condition runs off the end of the C stack on 64 bit
  processors.
  
  Test 4038 does a recursive call of a simple external function.
  Each invocation of the function allocates a bit over 16 kB of C stack
  on a 64 bit processor (half as much on a 32 bit processor).  The
  typical C stack on a unix system is 8 MB, so after no more than
  about 500 nested calls the stack pointer will move past the end
  of the allocated stack and cause a segfault.
  
  The fix is to not call the function as many times.  I've made the
  number of calls a constant and have added a note explaining its
  value.
  
  With this patch test 4038 passes consistently on OS X 64 bit.
  

    M ./tests/ghc-regress/ffi/should_run/4038.hs -1 +18

View patch online:
http://darcs.haskell.org/cgi-bin/darcsweb.cgi?r=testsuite;a=darcs_commitdiff;h=20110324170705-870a6-0317ea86f8384d2976d477656687918802ea0d08.gz



More information about the Cvs-ghc mailing list