summaryrefslogtreecommitdiff
path: root/rts/ProfHeap.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-12-22 19:43:41 -0500
committerBen Gamari <ben@well-typed.com>2018-12-25 11:18:52 -0500
commit9b65ae69fbeddcb9df7c70b71c9cf62be1e03dbd (patch)
tree8cbf325da624295958f21527b55bb02193ad53ea /rts/ProfHeap.c
parent7bfc1e81377d1e37069cf52bd090530124dcd871 (diff)
downloadhaskell-9b65ae69fbeddcb9df7c70b71c9cf62be1e03dbd.tar.gz
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.
Diffstat (limited to 'rts/ProfHeap.c')
-rw-r--r--rts/ProfHeap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index 517702f241..9ab4ff1c9d 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) {