Repository navigation
Don't synchronize command lists and queues that were destroyed - #739
Merged
Merged
Conversation
A task's stream can be collected in the same GC cycle as memory it last used. Julia doesn't order finalizers, so the stream's immediate command list is destroyed while the freed memory, returned to the pool, still names the stream as its owner. The next allocation of that memory from another task then waits for the stream, synchronizing the destroyed list, which segfaults in the driver. This crashed the `array` tests on Aurora. The finalizers only destroy a list or queue once its work is done, so treat a destroyed one as done. Mark them destroyed before destroying them, and do so for queues on every stack, not only on LTS.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #739 +/- ##
==========================================
- Coverage 85.71% 85.24% -0.48%
==========================================
Files 55 54 -1
Lines 4955 4831 -124
==========================================
- Hits 4247 4118 -129
- Misses 708 713 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A task's stream can be collected in the same GC cycle as memory it last used. Julia doesn't order finalizers, so the stream's immediate command list gets destroyed while the freed memory, returned to the pool, still names the stream as its owner. When another task later allocates that memory, it waits for the old owner and synchronizes the destroyed list, which segfaults in the driver. This is the crash in the
arraytests on Aurora (e.g. pipelines 71586 and 71605, from #734):It reproduces on an Arc A770 with the rolling stack too.
The finalizers only destroy a list or queue once its work is done (or the driver waits for it), so this treats a destroyed one as done. It also marks lists and queues destroyed before destroying them rather than after, and does so for queues on every stack, not only on LTS.
A finalizer running on another thread at the same time as the wait can still race with it. Closing that window needs a lock shared by the finalizers and every synchronization, which is left for later.
Fixes #736