summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViktor Dukhovni <ietf-dane@dukhovni.org>2021-01-02 01:00:51 -0500
committerViktor Dukhovni <ietf-dane@dukhovni.org>2021-01-02 12:54:13 -0500
commit6a62ca7ad1473c62045785b6acb6e15648da9394 (patch)
tree5dc4ef60b8ec552231a6f7f8e6c4ffc8d9055336
parent64c948e5ebccd7fd04d372d2de471dec9a330167 (diff)
downloadhaskell-ghc-8.8.tar.gz
Maintain invariant: MVars on mut_list are dirtywip/backports-8.8ghc-8.8
The previous patch was somewhat incomplete: while the MVars were correctly added to the mut_list via dirty_MVAR(), their info table remained "clean". While this is mostly harmless in non-debug builds, it trips an assertion in the debug build, and may result in the MVar being needlessly being added to the mut_list multiple times. Resolves: #19145
-rw-r--r--rts/PrimOps.cmm2
-rw-r--r--rts/Threads.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index 2966e26c5a..f5bd80d5a8 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -1748,6 +1748,7 @@ loop:
if (info == stg_MVAR_CLEAN_info) {
// Resolve #18919.
ccall dirty_MVAR(BaseReg "ptr", mvar "ptr");
+ info = stg_MVAR_DIRTY_info;
}
}
@@ -1837,6 +1838,7 @@ loop:
if (info == stg_MVAR_CLEAN_info) {
// Resolve #18919.
ccall dirty_MVAR(BaseReg "ptr", mvar "ptr");
+ info = stg_MVAR_DIRTY_info;
}
}
diff --git a/rts/Threads.c b/rts/Threads.c
index b28a696c57..949872ad17 100644
--- a/rts/Threads.c
+++ b/rts/Threads.c
@@ -793,6 +793,7 @@ loop:
if (info == &stg_MVAR_CLEAN_info) {
// Resolve #18919.
dirty_MVAR(&cap->r, (StgClosure*)mvar);
+ info = &stg_MVAR_DIRTY_info;
}
}