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
synth: Prevent data from being freed twice in AsyncPlugInCmd #4456
synth: Prevent data from being freed twice in AsyncPlugInCmd #4456
Conversation
…cPlugInCmd. Resolves issue supercollider#4338 Without this, World_Free is called on the same memory twice, as SequencedCmd also frees this pointer. This then causes the FIFO queue on the thread to get into trouble and render the server unresponsive.
Thanks! Can you please reformat this so it passes linting in our CI, @weefuzzy? Full instructions are here: https://github.com/supercollider/supercollider/wiki/Cpp-formatting-instructions#linting-and-formatting But if you just want to get this PR ready for merge, all you need to do is change the destructor to this: AsyncPlugInCmd::~AsyncPlugInCmd() { (mCleanup)(mWorld, mCmdData); } |
@brianlheim apologies, I'd totally missed the formatting requirements. Thanks for the quick fix, I'm on the move and upgrading clang seems ambitious for public wifi, so I've gone for the manual change. |
Caveat: There are other derived classes of SequencedCmd that call World_Free on destructor. so that:
|
Thanks @sonoro1234 . The issue isn't calling I can't comment much on the suggested changes to |
https://github.com/supercollider/supercollider/blob/develop/server/scsynth/SC_SequencedCommand.cpp#L305 and others |
|
You are right!! |
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.
Could test that it works as stated.
@snappizz should I merge this? squash merge?
@sonoro1234 Yes, this should be squash merged. Thanks for testing & reviewing! |
Purpose and Motivation
Without this, World_Free is called on the same memory twice, as SequencedCmd also frees this pointer. This then causes the FIFO queue on the thread to get into trouble and render the server unresponsive.
Fixes #4338
Types of changes
To-do list