Fix PortRegistration race causing heap corruption on plugin removal#96
Draft
sastraxi wants to merge 5 commits into
Draft
Fix PortRegistration race causing heap corruption on plugin removal#96sastraxi wants to merge 5 commits into
sastraxi wants to merge 5 commits into
Conversation
Signed-off-by: falkTX <falktx@falktx.com>
Signed-off-by: falkTX <falktx@falktx.com>
Signed-off-by: falkTX <falktx@falktx.com>
Signed-off-by: falkTX <falktx@falktx.com>
03f9994 to
120fe86
Compare
PortRegistration() enqueues POSTPONED_JACK_MIDI_CONNECT events on a JACK callback thread with no teardown guard. effects_remove() drains g_rtsafe_list in effects_remove_inner_pre(), then frees all plugin clients via lilv_instance_free()/dlclose()/jack_client_close(). Events arriving between the drain and those closes race against freed memory, corrupting the heap and causing SIGSEGV on the next dlclose(). Add a second splice-and-free drain immediately after the teardown loop in both effects_remove() and effects_remove_multi(), using the same pattern already present in effects_remove_inner_pre(). Closes mod-audio#94. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
120fe86 to
9732d45
Compare
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.
Fixes a race between
PortRegistration()andeffects_remove()that causes heap corruption andSIGSEGVwhen switching pedalboards while an rtmidi device is open.Fixes #94
Author checklist