Fix a memory leak found in fuzzing#8016
Closed
alexcrichton wants to merge 1 commit intobytecodealliance:mainfrom
Closed
Fix a memory leak found in fuzzing#8016alexcrichton wants to merge 1 commit intobytecodealliance:mainfrom
alexcrichton wants to merge 1 commit intobytecodealliance:mainfrom
Conversation
This fixes a mistake introduced in bytecodealliance#7996 where a `global.get` used to initialize a table did not properly drop previous items in the table causing them to leak as the reference count was not decremented.
fitzgen
approved these changes
Feb 28, 2024
Member
fitzgen
left a comment
There was a problem hiding this comment.
Regression test in tests/all/gc.rs? Can use the SetFlagOnDrop helper.
alexcrichton
added a commit
to alexcrichton/wasmtime
that referenced
this pull request
Feb 28, 2024
This commit is an attempt to make the mistake fixed in bytecodealliance#8016 harder to happen again. This removes the `set_raw` helper entirely from tables and instead forces all callers to view the table as either a table of funcrefs or a table of externefs. By forcing that choice outwards instead of handling it inwards it enables dealing with a typed table in more contexts which should help naturally do the right thing.
Member
Author
|
Actually, there's another issue I've found, so I've opted for a larger refactor in #8018 to fix this (test included over there) |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 28, 2024
This commit is an attempt to make the mistake fixed in #8016 harder to happen again. This removes the `set_raw` helper entirely from tables and instead forces all callers to view the table as either a table of funcrefs or a table of externefs. By forcing that choice outwards instead of handling it inwards it enables dealing with a typed table in more contexts which should help naturally do the right thing.
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.
This fixes a mistake introduced in #7996 where a
global.getused to initialize a table did not properly drop previous items in the table causing them to leak as the reference count was not decremented.