Skip to content
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

OSC (open sound control) - /q/all_params can crash Surge XT on Mac #7410

Closed
gitsmol opened this issue Dec 25, 2023 · 5 comments · Fixed by #7413
Closed

OSC (open sound control) - /q/all_params can crash Surge XT on Mac #7410

gitsmol opened this issue Dec 25, 2023 · 5 comments · Fixed by #7413
Labels
Bug Report Item submitted using the Bug Report template

Comments

@gitsmol
Copy link
Contributor

gitsmol commented Dec 25, 2023

Bug Description:
I'm the guy making a TouchOSC-template for Surge XT. Currently, to keep the TouchOSC interface in sync with Surge, I have to get a number of different params when changing oscillator types. This is because the osc-types have different controls for param 1-7 and so when changing osc-types I just query for all parameter info.

When switching from osc-type 'String' to 'Twist', and immediately fetching all params, Surge will reliably crash on Mac OS.
I'm sending these OSC messages:

/param/a/osc/1/type 10
/q/all_params

Unfortunately I'm away from home right now and don't have a linux box on hand to test other setups.

Surge XT Version

  • Version: 1.3.0.20a8e16
  • Plugin Type: Standalone
  • Bitness: 64-bit

Reproduction Steps:
As described, using TouchOS.
In the testscript used by @pkstone, adding and running the following code will crash Surge.

def trigger_crash():
    msg = obp.OSCMessage("/param/a/osc/1/type", ",f", [9.0])
    osc_send(msg, "oscout")
    osc_process()
    
    msg = obp.OSCMessage("/param/a/osc/1/type", ",f", [10.0])
    osc_send(msg, "oscout")
    osc_process()
    
    msg = obp.OSCMessage("/q/all_params", ",", [])
    osc_send(msg, "oscout")
    osc_process()

Expected Behavior:
After changing the osc type, Surge sends OSC messages for all of its params.

Computer Information (please complete the following!):

  • OS: Mac OS 13.6.1
  • Host: Standalone

Attached is a crashlog generated by Mac OS.
surge_crashlog_231225.txt

@gitsmol gitsmol added the Bug Report Item submitted using the Bug Report template label Dec 25, 2023
@baconpaul
Copy link
Collaborator

I was sitting here thinking “I bet the crash log is in the dynamic value code” and hey voila there it is

I bet there’s a timing issue with the oscillator switching later than the Param inquiry. Thanks for the excellent report

@pkstone
Copy link
Contributor

pkstone commented Dec 26, 2023

Yes, great use of the script for an excellent report. Paul, is there anything I need to help with on this?

@baconpaul
Copy link
Collaborator

Nah I'll just have to look and fix it - something is out of order or on the wrong thread or not defensive enough with the parameter type switches

@pkstone
Copy link
Contributor

pkstone commented Dec 26, 2023

Great!
I can only repeat the crash if I turn off the printout of the resulting parameter dump in the Python script. Maybe the printing slows things down enough to prevent the condition that causes the crash?

@baconpaul
Copy link
Collaborator

That makes sense. If the audio thread runs and settles down then is configuration won’t be there any more

@baconpaul baconpaul added this to the Surge XT 1.3.1 milestone Dec 27, 2023
baconpaul added a commit to baconpaul/surge that referenced this issue Dec 27, 2023
The twist engine lacked a defensive test for the bipolar detector
which meant some automation events which didn't load an entire
oscillator state could result in an out of boudns read.

Closes surge-synthesizer#7410
baconpaul added a commit that referenced this issue Dec 27, 2023
The twist engine lacked a defensive test for the bipolar detector
which meant some automation events which didn't load an entire
oscillator state could result in an out of boudns read.

Closes #7410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Item submitted using the Bug Report template
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants