summaryrefslogtreecommitdiff
path: root/rts/StgMiscClosures.cmm
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2013-11-21 11:28:13 +0000
committerSimon Marlow <marlowsd@gmail.com>2013-11-21 13:27:34 +0000
commite82fa82933e6984c5b9507a0d857b0c579bd0f46 (patch)
treec2fc68c44afdf36bb84014a511807567f42fdec3 /rts/StgMiscClosures.cmm
parentef89860cb51f4d456caf924f9f9075b2b95ccc52 (diff)
downloadhaskell-e82fa82933e6984c5b9507a0d857b0c579bd0f46.tar.gz
In the DEBUG rts, track when CAFs are GC'd
This resurrects some old code and makes it work again. The idea is that we want to get an error message if we ever enter a CAF that has been GC'd, rather than following its indirection which will likely cause a segfault. Without this patch, these bugs are hard to track down in gdb, because the IND_STATIC code overwrites R1 (the pointer to the CAF) with its indirectee before jumping into bad memory, so we've lost the address of the CAF that got GC'd. Some associated refactoring while I was here.
Diffstat (limited to 'rts/StgMiscClosures.cmm')
-rw-r--r--rts/StgMiscClosures.cmm7
1 files changed, 7 insertions, 0 deletions
diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm
index 9484031832..b8122b479e 100644
--- a/rts/StgMiscClosures.cmm
+++ b/rts/StgMiscClosures.cmm
@@ -556,6 +556,13 @@ INFO_TABLE_CONSTR(stg_END_TSO_QUEUE,0,0,0,CONSTR_NOCAF_STATIC,"END_TSO_QUEUE","E
CLOSURE(stg_END_TSO_QUEUE_closure,stg_END_TSO_QUEUE);
/* ----------------------------------------------------------------------------
+ GCD_CAF
+ ------------------------------------------------------------------------- */
+
+INFO_TABLE_CONSTR(stg_GCD_CAF,0,0,0,CONSTR_NOCAF_STATIC,"GCD_CAF","GCD_CAF")
+{ foreign "C" barf("Evaluated a CAF that was GC'd!") never returns; }
+
+/* ----------------------------------------------------------------------------
STM_AWOKEN
This is a static nullary constructor (like []) that we use to mark a