david-c14 / SubmarineFree

Free plugins for VCV Rack
Other
48 stars 10 forks source link

v2: Crash in XFX.cpp #182

Closed cschol closed 2 years ago

cschol commented 2 years ago

link is uninitialized and causes a crash in certain conditions (adding all modules to a patch at once). cv could have similar problems and should be initialized also, but initializing link fixes the issue.

struct XF_LightKnob : LargeKnob<NarrowKnob<LightKnob>> {                                                  
    int cv;                                                                                          
    int link;                                                                                                    
    void step() override {                                                                            
[...] 
                      setEnabled(!module->inputs[cv].isConnected() && (module->params[link].getValue() < 0.5f));                      
david-c14 commented 2 years ago

Thank you for finding this.

This is now fixed and will be available when I next do a release.

Have there been any actually reported crashes that implicate this?

cschol commented 2 years ago

We are not sure. Andrew found this crash with a test case of adding all modules of a brand to the Rack at once.

david-c14 commented 2 years ago

Thanks. It's not theoretical then. I'll release sooner rather than later.