Commit ab8bb489 authored by Simon Marlow's avatar Simon Marlow
Browse files

Fix scavenge_stack crash (#9045)

The new stg_gc_prim_p_ll stack frame was missing an info table.  This
is a regression since 7.6, because this stuff was part of a cleanup
that happened in 7.7.
parent a3896ab5
......@@ -196,7 +196,8 @@ stg_gc_prim_n (W_ arg, W_ fun)
jump fun(arg);
}
stg_gc_prim_p_ll_ret
INFO_TABLE_RET(stg_gc_prim_p_ll, RET_SMALL, W_ info, P_ arg, W_ fun)
/* explicit stack */
{
W_ fun;
P_ arg;
......@@ -216,7 +217,7 @@ stg_gc_prim_p_ll
Sp_adj(-3);
Sp(2) = fun;
Sp(1) = arg;
Sp(0) = stg_gc_prim_p_ll_ret;
Sp(0) = stg_gc_prim_p_ll_info;
jump stg_gc_noregs [];
}
......
-- This is nofib/smp/threads006. It fails in GHC 7.8.2 with a GC crash.
{-# OPTIONS_GHC -O2 #-}
import System.IO
import System.Environment
import System.CPUTime
import Text.Printf
import Control.Monad
import Control.Concurrent
import Control.Concurrent.MVar
import Control.Exception
main :: IO ()
main = do
hSetBuffering stdout NoBuffering
[nthreads] <- fmap (map read) getArgs
tids <- replicateM nthreads . mask $ \_ -> forkIO $ return ()
m <- newEmptyMVar
-- do it in a subthread to avoid bound-thread overhead
forkIO $ do mapM_ killThread tids; putMVar m ()
takeMVar m
return ()
......@@ -222,3 +222,8 @@ test('T8124', [ only_ways(threaded_ways), omit_ways(['ghci']),
# T8124_stub.h before compiling T8124_c.c, which
# needs it.
compile_and_run, ['T8124_c.c -no-hs-main'])
# +RTS -A8k makes it fail faster
# The ghci way gets confused by the RTS options
test('T9045', [ omit_ways(['ghci']), extra_run_opts('10000 +RTS -A8k -RTS') ], compile_and_run, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment