From 3bdd3218d512ba5235cb65b008729c7e6f41fb11 Mon Sep 17 00:00:00 2001 From: Peter Wortmann Date: Fri, 12 Oct 2012 16:53:08 +0100 Subject: [PATCH] Don't silently truncate blocks when encountering EVENT_DATA_END Blocks should never contain these, getEventBlock should simply run out of data instead. It's less surprising to fail here. --- GHC/RTS/Events.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GHC/RTS/Events.hs b/GHC/RTS/Events.hs index 176e525..bad9e0a 100644 --- a/GHC/RTS/Events.hs +++ b/GHC/RTS/Events.hs @@ -631,7 +631,9 @@ getEventBlock parsers = do if b then return [] else do mb_e <- getEvent parsers case mb_e of - Nothing -> return [] + -- This is almost certainly a data corruption. Just silently + -- truncating the block is probably not a good idea. + Nothing -> fail "Unexpected data end marker inside block!" Just e -> do es <- getEventBlock parsers return (e:es)