Harden fixST
AcceptedPublic

Authored by dfeuer on Mon, Jul 9, 1:13 PM.

Details

Reviewers
simonmar
hvr
bgamari
Trac Issues
#15349
Summary

Trac Trac #15349 reveals that lazy blackholing can cause trouble for
fixST much like it can for fixIO. Make fixST work just
like fixIO.

dfeuer created this revision.Mon, Jul 9, 1:13 PM

Can you add a test please?

dfeuer updated this revision to Diff 17262.Tue, Jul 10, 1:27 PM
  • Fix lazy ST; add tests

Can you add a test please?

Done. Unfortunately, all my attempts to fix lazy ST using noDuplicate# failed the test when compiled with -O0. I wish I understood why, so I could feel more confident that we don't have more troubles lurking in that module. Lazy ST is really subtle. In the mean time, I implemented the lazy ST version using an MVar as well; that seems to work.

dfeuer planned changes to this revision.Tue, Jul 10, 2:00 PM

Oh, bleh! I just realized my lazy version is still wrong. It's too strict sometimes, and I think it can also have trouble from the putMVar not actually happening. What a mess....

dfeuer updated this revision to Diff 17265.Tue, Jul 10, 3:55 PM
  • Back out lazy ST changes
dfeuer updated this revision to Diff 17266.Tue, Jul 10, 3:59 PM
  • Back out lazy ST changes
simonmar accepted this revision.Mon, Jul 16, 4:23 AM

I don't think noDuplicate# has any well-defined semantics that we can rely on, so I'm not entirely surprised that you found it difficult to use it to fix Lazy ST.

I presume we're good here for strict ST at least?

This revision is now accepted and ready to land.Mon, Jul 16, 4:23 AM