rts/RetainerProfile: Dump closure type if pop() fails
authorRyan Scott <ryan.gl.scott@gmail.com>
Tue, 21 Aug 2018 20:04:45 +0000 (16:04 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 21 Aug 2018 22:56:11 +0000 (18:56 -0400)
While investigating #15529, I noticed that the `barf`ed
error message in `pop()` doesn't print out the closure type that
causes it to crash. Let's do so.

Reviewers: bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #15529

Differential Revision: https://phabricator.haskell.org/D5072

rts/RetainerProfile.c

index 6a0af21..9458b13 100644 (file)
@@ -897,7 +897,7 @@ pop( StgClosure **c, StgClosure **cp, retainer *r )
         case IND:
         case INVALID_OBJECT:
         default:
-            barf("Invalid object *c in pop()");
+            barf("Invalid object *c in pop(): %d", get_itbl(se->c)->type);
             return;
         }
     } while (true);