ci: Update aggressive GC settings for Lua 5.5, fix potential use-after-frees#820
Merged
squeek502 merged 4 commits intoluvit:masterfrom Mar 30, 2026
Merged
ci: Update aggressive GC settings for Lua 5.5, fix potential use-after-frees#820squeek502 merged 4 commits intoluvit:masterfrom
squeek502 merged 4 commits intoluvit:masterfrom
Conversation
The previous call only switched to the incremental GC, the numbers afterwards are the Lua 5.4-specific way of setting the pause and stepmul.
Member
Author
|
Wasn't expecting this to find actual failures 🙃 Looks to be scandir related EDIT: This is actually finding quite a bit. I guess previous Lua versions never really let us tune the GC to be this aggressive (Lua 5.5 allows "producing a non-incremental, stop-the-world collector"). Or we just didn't tune it as aggressively as possible. |
…lled Previously, it was technically possible for the userdata to be garbage collected before the fulfill_req call, leading to a use-after-free.
This assert is not guaranteed to always be correct, e.g. with a maximally aggressive/stop-the-world incremental GC.
…o GC it It was technically possible for the luv_dir_t to be garbage collected, which would lead to the dirent data being unref'ed and that *also* could garbage collected, before one of the luv_push_dirent calls that use the dirent data (i.e. a possible use-after-free). Seems very unlikely in real-world usage, but 100% reproducible with a maximally aggressive/stop-the-world GC.
truemedian
approved these changes
Mar 30, 2026
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.
The previous call only switches to the incremental GC in Lua 5.5; the numbers afterwards are the Lua 5.4-specific way of setting the pause and stepmul.