surge-synthesizer / stochas

The Stochas Sequencer
https://stochas.org
GNU General Public License v3.0
404 stars 35 forks source link

Multiple Automation Clips of Transpose Parameter L1 crashes Reaper #138

Closed codecollider closed 4 months ago

codecollider commented 5 months ago

Hi,

Reaper 7.09 is reproducible crashing when starting a new project. Load one instance of Stochas.

Choose L1 transpose as automation parameter and make an arbitrary automation clip.

https://imgur.com/biQ5z0e.png

Duplicate the clip several times

https://imgur.com/B5bp22z.png

Reaper might crash already while copy / pasting the clip. If not press play and keep on duplicating the clip.

gdb gives me:


`Thread 1 "reaper" received signal SIGSEGV, Segmentation fault.
0x00007fffcb40fcff in juce::CharPointer_ASCII::isEmpty() const () from /home/fox/.vst3/Stochas.vst3/Contents/x86_64-linux/Stochas.so
#0  0x00007fffcb40fcff in juce::CharPointer_ASCII::isEmpty() const () at /home/fox/.vst3/Stochas.vst3/Contents/x86_64-linux/Stochas.so
#1  0x00007fffcb434bf3 in juce::CharPointer_UTF8 juce::StringHolder::createFromCharPointer<juce::CharPointer_ASCII>(juce::CharPointer_ASCII) () at /home/fox/.vst3/Stochas.vst3/Contents/x86_64-linux/Stochas.so
#2  0x00007fffcb3d095b in juce::String::String(char const*) () at /home/fox/.vst3/Stochas.vst3/Contents/x86_64-linux/Stochas.so
#3  0x00007fffcb061603 in SeqAudioProcessor::getTextForAutomationParameterValue(int, int) () at /home/fox/.vst3/Stochas.vst3/Contents/x86_64-linux/Stochas.so
#4  0x00007fffcb061284 in SeqAudioProcessorParameter::getText(float, int) const () at /home/fox/.vst3/Stochas.vst3/Contents/x86_64-linux/Stochas.so
#5  0x00007fffcb01bb25 in juce::JuceVST3EditController::Param::toString(double, char16_t*) const () at /home/fox/.vst3/Stochas.vst3/Contents/x86_64-linux/Stochas.so
#6  0x00007fffcb003d8f in Steinberg::Vst::EditController::getParamStringByValue(unsigned int, double, char16_t*) () at /home/fox/.vst3/Stochas.vst3/Contents/x86_64-linux/Stochas.so
#7  0x0000000000a0ad26 in  ()
#8  0x00000000009ea3f6 in  ()
#9  0x00000000008242b4 in  ()
#10 0x00000000007fa58f in  ()
#11 0x000000000043eb3d in  ()
#12 0x00000000004aa27b in  ()
#13 0x000000000076eb73 in  ()
#14 0x00000000007952a2 in  ()
#15 0x0000000000b327be in  ()
`
my system:

Host: fox Kernel: 5.10.0-27-amd64 x86_64 bits: 64 Desktop: Xfce 4.18.1 
           Distro: MX-21.3_x64 Wildflower September 18  2022 
Machine:   Type: Desktop Mobo: MSI model: H81M-E34 (MS-7817) v: 3.0 serial: <superuser required> UEFI: American Megatrends 
           v: 17.5 date: 03/30/2015 
CPU:       Info: Quad Core model: Intel Core i5-4460 bits: 64 type: MCP cache: L2: 6 MiB 
           Speed: 2882 MHz min/max: 800/3200 MHz Core speeds (MHz): 1: 2882 2: 2671 3: 2614 4: 2709 
Graphics:  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics driver: i915 v: kernel 
           Display: x11 server: X.Org 1.20.11 driver: loaded: modesetting unloaded: fbdev,vesa resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4600 (HSW GT2) v: 4.5 Mesa 20.3.5 
Audio:     Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio driver: snd_hda_intel 
           Device-2: BEHRINGER UMC204HD 192k type: USB driver: snd-usb-audio 
           Device-3: AKAI Professional M.I. MPK Mini Mk II type: USB driver: hid-generic,snd-usb-audio,usbhid 
           Sound Server-1: ALSA v: k5.10.0-27-amd64 running: yes 
           Sound Server-2: JACK v: 1.9.21 running: yes 
           Sound Server-3: PulseAudio v: 14.2 running: yes 
baconpaul commented 5 months ago

Almost definitely the case that in a debug build https://github.com/surge-synthesizer/stochas/blob/8d9ff47a7a662bb95970807949b205b10d81d032/src/Scale.cpp#L206 that assert would fire. Probably need a clamp in the release build in case we are out of bounds.

rudeog commented 4 months ago

Ok this is fixed. Apparently Reaper, when you stack multiple automation clips on top of each other will sum the value for both. The range as documented in Juce is 0..1 but I'm seeing values over 1 in this case. It could be a Juce thing (which may be fixed in a later version, didn't check) or a Reaper thing.