closure mutation not recorded in threadPaused, also assertion wrong
While experimenting with making all black holes eager, I found that I sometimes saw segfaults, so I've been investigating. I think I found the problem.
My recent fix for eager-blackhole deadlocks, !14734, avoids overwriting eager black holes, to prevent losing wakeups. While it's correct to not overwrite the black hole contents, I found two problems with the fix, one serious:
- (serious): `recordClosureMutated` is not called on an eager black hole. While `ThreadPaused.c` does not mutate the closure, we must still call `recordClosureMutated` because the mutator changed it.
- (less serious): the line `ASSERT(blackHoleOwner(bh) == tso || blackHoleOwner(bh) == NULL);` is incorrect, since with `-feager-blackholing` we get non-atomic eager black holes. Multiple threads may race and claim. The usual mechanism for thunk updating resolves the collision.
issue