X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FStorage.c;h=6fa90cf8e9ef4f6bae3a7590638181256fa21b8f;hb=5a5acb3698aa4ffdd738c301fa722afe12a1f3de;hp=bf7c452d9be185b4954e37cb567a032e40845524;hpb=3ebcd3deb769a03f4ded0fca2cf38201048c0214;p=ghc-hetmet.git diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index bf7c452..6fa90cf 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -617,6 +617,13 @@ allocateInGen (generation *g, lnat n) if (RtsFlags.GcFlags.maxHeapSize > 0 && req_blocks >= RtsFlags.GcFlags.maxHeapSize) { heapOverflow(); + // heapOverflow() doesn't exit (see #2592), but we aren't + // in a position to do a clean shutdown here: we + // either have to allocate the memory or exit now. + // Allocating the memory would be bad, because the user + // has requested that we not exceed maxHeapSize, so we + // just exit. + stg_exit(EXIT_HEAPOVERFLOW); } bd = allocGroup(req_blocks);