Report heap overflow in the same way as stack overflow
authorSimon Marlow <marlowsd@gmail.com>
Sat, 1 Apr 2017 23:52:40 +0000 (19:52 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 2 Apr 2017 16:01:47 +0000 (12:01 -0400)
commit61ba4518a48727f8cd7b821bd41631da82d37425
tree421493e6de4af7744876c7a927b60e2a7b452112
parentd89b0471888b15844b8bbf68159fe50830be8b24
Report heap overflow in the same way as stack overflow

Now that we throw an exception for heap overflow, we should only print
the heap overflow message in the main thread when the HeapOverflow
exception is caught, rather than as a side effect in the GC.

Stack overflows were already done this way, I just made heap overflow
consistent with stack overflow, and did some related cleanup.

Fixes broken T2592(profasm) which was reporting the heap overflow
message twice (you would only notice when building with profiling
libs enabled).

Test Plan: validate

Reviewers: bgamari, niteria, austin, DemiMarie, hvr, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3394
includes/Rts.h
libraries/base/GHC/Conc.hs
libraries/base/GHC/Conc/Sync.hs
libraries/base/GHC/TopHandler.hs
rts/RtsSymbols.c
rts/RtsUtils.c
rts/RtsUtils.h
rts/sm/CNF.c
rts/sm/GC.c
rts/sm/Storage.c
testsuite/tests/rts/T1791/T1791.stderr [deleted file]