summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-12-23 00:43:41 (GMT)
committerBen Gamari <ben@well-typed.com>2018-12-25 16:18:52 (GMT)
commit9b65ae69fbeddcb9df7c70b71c9cf62be1e03dbd (patch)
tree8cbf325da624295958f21527b55bb02193ad53ea
parent7bfc1e81377d1e37069cf52bd090530124dcd871 (diff)
downloadghc-9b65ae69fbeddcb9df7c70b71c9cf62be1e03dbd.zip
ghc-9b65ae69fbeddcb9df7c70b71c9cf62be1e03dbd.tar.gz
ghc-9b65ae69fbeddcb9df7c70b71c9cf62be1e03dbd.tar.bz2
rts: Turn ASSERT in LDV_recordDead into a normal if
As reported in #15382 the `ASSERT(ctr != NULL)` is currently getting routinely hit during testsuite runs. While this is certainly a bug I would far prefer getting a proper error message than a segmentation fault. Consequently I'm turning the `ASSERT` into a proper `if` so we get a proper error in non-debug builds.
-rw-r--r--rts/ProfHeap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index 517702f..9ab4ff1 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -201,7 +201,9 @@ LDV_recordDead( const StgClosure *c, uint32_t size )
} else {
id = closureIdentity(c);
ctr = lookupHashTable(censuses[t].hash, (StgWord)id);
- ASSERT( ctr != NULL );
+ if (ctr == NULL)
+ barf("LDV_recordDead: Failed to find counter for closure %p", c);
+
ctr->c.ldv.void_total += size;
ctr = lookupHashTable(censuses[era].hash, (StgWord)id);
if (ctr == NULL) {