From d90946cea1357d3e99805c27dab1e811785a4088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Mon, 24 Sep 2018 16:21:27 +0300 Subject: Fix a MSG_BLACKHOLE sanity check, add some comments Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15508 Differential Revision: https://phabricator.haskell.org/D5178 --- rts/sm/Sanity.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'rts') diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c index 8d4171b1cd..c6861f4134 100644 --- a/rts/sm/Sanity.c +++ b/rts/sm/Sanity.c @@ -292,8 +292,12 @@ checkClosure( const StgClosure* p ) ASSERT(LOOKS_LIKE_CLOSURE_PTR(bq->bh)); ASSERT(get_itbl((StgClosure *)(bq->owner))->type == TSO); - ASSERT(bq->queue == (MessageBlackHole*)END_TSO_QUEUE - || bq->queue->header.info == &stg_MSG_BLACKHOLE_info); + ASSERT(// A bq with no other blocked TSOs: + bq->queue == (MessageBlackHole*)END_TSO_QUEUE || + // A bq with blocked TSOs in its queue: + bq->queue->header.info == &stg_MSG_BLACKHOLE_info || + // A bq with a deleted (in throwToMsg()) MSG_BLACKHOLE: + bq->queue->header.info == &stg_IND_info); ASSERT(bq->link == (StgBlockingQueue*)END_TSO_QUEUE || get_itbl((StgClosure *)(bq->link))->type == IND || get_itbl((StgClosure *)(bq->link))->type == BLOCKING_QUEUE); -- cgit v1.2.1