-
Notifications
You must be signed in to change notification settings - Fork 111
Fix mysterious hanging issue #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix mysterious hanging issue #550
Conversation
| -> Seed | ||
| -> Property | ||
| -> m (Report Result) | ||
| checkRegion region color name size seed prop = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to remove it from hedgehog/src/Hedgehog/Internal/Runner.hs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot remove those because they are needed by other functions in the Runner module.
moodmosaic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @newhoggy. Good catch with setRegion vs openRegion. If the fix is in how checkNamed and checkRegion handle region output, was the new module strictly needed?
I cannot spot any difference with regards to |
|
@Bodigrim, the fix is the |
|
It looks like this was caused by a GHC bug causing threads to get stuck when multiple threads would enter a CAF closure in quick succession. You can try my proposed fix here: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/14734 If this is indeed the correct fix for the problem, we'll likely backport it to 9.10 and 9.12 |
|
Wow! Thank you @luite for this incredible insight and for tracking this down to a potential GHC bug! It seems I was mistaken earlier. Based on your analysis, the key change is the module split itself, which serves as a structural workaround for the GHC bug related to CAF contention, rather than any specific logic change in Given that the permanent solution lies upstream in GHC, I propose the following plan:
Many thanks to @newhoggy for discovering a workaround that not only unblocked users but also helped lead to the discovery of this underlying GHC issue. |
This is more of a work-around, but moving the
checkto a newHedgehog.Internal.Checkmodule, then copyingcheckNamedandcheckRegionfunctions to the same module solves a mysterious hanging issue when usingtastyandhedgehogtogether.The hang is verified to no longer happen with these changes by running the test in this branch:
https://github.com/newhoggy/tasty-hang/tree/newhoggy/fix-mysterious-hanging-issue
To run test, run:
then use this to watch for a hang:
Resolves #547