Commit fb1f0a46 authored by Simon Marlow's avatar Simon Marlow Committed by David Feuer
Browse files

Blackholes can be large objects (#14497)

Test Plan: validate

Reviewers: bgamari, niteria, erikd, dfeuer

Reviewed By: dfeuer

Subscribers: Yuras, dfeuer, rwbarton, thomie, carter

GHC Trac Issues: #14497

Differential Revision: https://phabricator.haskell.org/D4254
parent f1fe5b4a
......@@ -898,9 +898,16 @@ evacuate_BLACKHOLE(StgClosure **p)
bd = Bdescr((P_)q);
// blackholes can't be in a compact, or large
ASSERT((bd->flags & (BF_COMPACT | BF_LARGE)) == 0);
// blackholes can't be in a compact
ASSERT((bd->flags & BF_COMPACT) == 0);
// blackholes *can* be in a large object: when raiseAsync() creates an
// AP_STACK the payload might be large enough to create a large object.
// See #14497.
if (bd->flags & BF_LARGE) {
evacuate_large((P_)q);
return;
}
if (bd->flags & BF_EVACUATED) {
if (bd->gen_no < gct->evac_gen_no) {
gct->failed_to_evac = true;
......
module Main (main) where
import System.Timeout
fuc :: Integer -> Integer
fuc 0 = 1
fuc n = n * fuc (n - 1)
main :: IO ()
main = do
let x = fuc 30000
timeout 1000 (print x)
print (x > 0)
......@@ -381,3 +381,4 @@ test('T12497', [ unless(opsys('mingw32'), skip)
test('T12903', [when(opsys('mingw32'), skip)], compile_and_run, [''])
test('T13832', exit_code(1), compile_and_run, ['-threaded'])
test('T13894', normal, compile_and_run, [''])
test('T14497', normal, compile_and_run, ['-O'])
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