stoermelder / vcvrack-packone

Modules for VCV Rack
GNU General Public License v3.0
173 stars 38 forks source link

Strip randomisation crashes V2beta1 on patch reload (linux) #297

Closed ContemporaryInsanity closed 1 year ago

ContemporaryInsanity commented 2 years ago

If I repeatedly randomise a couple of modules using strip driven by a clock, all works as expected. Exit & restart rack and it crashes consistently.

Tail of log.txt:

[2.402 info src/window/Svg.cpp:28 loadFile] Loaded SVG /home/ewen/Rack2/res/ComponentLibrary/TinyLight.svg [2.402 info src/window/Svg.cpp:28 loadFile] Loaded SVG /home/ewen/.Rack2/plugins/Bogaudio/res/SampleHold-dark.svg [2.402 info src/window/Svg.cpp:28 loadFile] Loaded SVG /home/ewen/.Rack2/plugins/Bogaudio/res/button_18px_0.svg [2.402 info src/window/Svg.cpp:28 loadFile] Loaded SVG /home/ewen/.Rack2/plugins/Bogaudio/res/button_18px_1.svg [2.406 fatal adapters/standalone.cpp:60 fatalSignalHandler] Fatal signal 11 SIGSEGMENTATION FAULT. Stack trace: 12: ./Rack() [0x403ccf] 11: /lib/x86_64-linux-gnu/libc.so.6(+0x3f040) [0x7fd51fe3a040] 10: ./libRack.so(_ZN4rack3app12ModuleWidget9getParamsEv+0x4e) [0x7fd52090b71e] 9: /home/ewen/.Rack2/plugins/Stoermelder-P1/plugin.so(_ZN18StoermelderPackOne5Strip11StripModule14groupRandomizeEb+0x3b0) [0x7fd504ead8f0] 8: /home/ewen/.Rack2/plugins/Stoermelder-P1/plugin.so(_ZN18StoermelderPackOne5Strip11StripModule7processERKN4rack6engine6Module11ProcessArgsE+0x161) [0x7fd504eadcc1] 7: ./libRack.s

pgatt commented 1 year ago

Mac as well here, on Rack 2.1.2

log.txt

ContemporaryInsanity commented 1 year ago

prob-key into pink trombone with Strip randomising PT every gate from PK, run it long enough, exit, reload, guaranteed crash.

Seems Strip accumulates something or other over quite some time, saves state on exit, then crashes on reload. I've never had it crash any other way after many hours, only on exit & reload.

Considering Strips minimal functionality, the only thing that needs to persist is excluded params (I think?), so I hope this could be an easy fix.

Randomising voices on gates via Strip is one of my favourite tricks. Thanks once more for a truly unique & superb set of modules.

[1.504 fatal adapters/standalone.cpp:49 fatalSignalHandler] Fatal signal 11. Stack trace: 9: ./Rack() [0x403c8d] 8: /lib/x86_64-linux-gnu/libc.so.6(+0x42520) 7: ./libRack.so(rack::app::ModuleWidget::getParams()+0x51) 6: /home/ewen/.Rack2/plugins/Stoermelder-P1/plugin.so(StoermelderPackOne::Strip::StripModule::groupRandomize(bool)+0x3b1) 5: /home/ewen/.Rack2/plugins/Stoermelder-P1/plugin.so(StoermelderPackOne::Strip::StripModule::process(rack::engine::Module::ProcessArgs const&)+0x169) 4: ./libRack.so(rack::engine::Module::doProcess(rack::engine::Module::ProcessArgs const&)+0xa42) 3: ./libRack.so(rack::engine::EngineWorker::run()+0x191) 2: ./libRack.so(+0x82eb60) 1: /lib/x86_64-linux-gnu/libc.so.6(+0x94947) 0: /lib/x86_64-linux-gnu/libc.so.6(clone+0x44)

higaru2 commented 1 year ago

same behaviour of Strip on Mac (osx)... I replicated the setup above. thanks in advance for fixing this. your modules are fabulous. thank you!!!!

On Thu, Oct 27, 2022 at 8:55 PM Ewen Bates @.***> wrote:

prob-key into pink trombone with Strip randomising PT every gate from PK, run it long enough, exit, reload, guaranteed crash.

Seems Strip accumulates something or other over quite some time, saves state on exit, then crashes on reload. I've never had it crash any other way after many hours, only on exit & reload.

Considering Strips minimal functionality, the only thing that needs to persist is excluded params (I think?), so I hope this could be an easy fix.

Randomising voices on gates via Strip is one of my favourite tricks. Thanks once more for a truly unique & superb set of modules.

[1.504 fatal adapters/standalone.cpp:49 fatalSignalHandler] Fatal signal

  1. Stack trace: 9: ./Rack() [0x403c8d] 8: /lib/x86_64-linux-gnu/libc.so.6(+0x42520) 7: ./libRack.so(rack::app::ModuleWidget::getParams()+0x51) 6: /home/ewen/.Rack2/plugins/Stoermelder-P1/plugin.so(StoermelderPackOne::Strip::StripModule::groupRandomize(bool)+0x3b1) 5: /home/ewen/.Rack2/plugins/Stoermelder-P1/plugin.so(StoermelderPackOne::Strip::StripModule::process(rack::engine::Module::ProcessArgs const&)+0x169) 4: ./libRack.so(rack::engine::Module::doProcess(rack::engine::Module::ProcessArgs const&)+0xa42) 3: ./libRack.so(rack::engine::EngineWorker::run()+0x191) 2: ./libRack.so(+0x82eb60) 1: /lib/x86_64-linux-gnu/libc.so.6(+0x94947) 0: /lib/x86_64-linux-gnu/libc.so.6(clone+0x44)

— Reply to this email directly, view it on GitHub https://github.com/stoermelder/vcvrack-packone/issues/297#issuecomment-1293876051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3ZRBOCHMTJARUYLIX7TKTWFK6ZPANCNFSM5IYMRDXA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ContemporaryInsanity commented 1 year ago

I decided to resurrect Racket Science for v2 and the first thing I've done is a super basic module randomiser based on Strip.

On a button or trigger it randomises the module to the immediate right, that's it, nothing more fancy than that, Grip can be used to exclude individual controls from randomisation.

I picked through Ben's code and took the absolute minimum to do what I wanted.

Exactly the same problem persisted.

After some experimentation and a few subtle changes I now believe it is working fine, there appeared to be an issue with ensuring we had a fully functional module to randomise, hence the problem only manifesting at startup / reload when Strip randomisation is being triggered from the start.

void process(const ProcessArgs& args) override {
    if(randTrigger.process(params[RAND_BUTTON].getValue() + inputs[RAND_INPUT].getVoltage())) {
        Module *m = this;
        if(!m) return;
        if(m->rightExpander.moduleId < 0) return;

        ModuleWidget *mw = APP->scene->rack->getModule(m->rightExpander.moduleId);
        if(!mw) return;

        for(ParamWidget *param : mw->getParams()) {
            param->getParamQuantity()->randomize();
        }
    }
}
stoermelder commented 1 year ago

Seems to be a problem on Mac only, I can't reproduce any crash on Windows. Can you provide a patch?

higaru2 commented 1 year ago

yep! here we go:

on v8 just move the pink trombone near the strip and it usually crashes after random time... ( sometimes in few seconds )

in vX ( that is with the modules already close ) it crashes also after random time sometimes on load

what is odd - is that after your latest nightly update it doesnt crash so hard - but it still does...

big thanks !!!!

files are here: https://workupload.com/archive/cSXRGjD3

On Tue, Nov 15, 2022 at 10:17 PM Ben @.***> wrote:

Seems to be a problem on Mac only, I can't reproduce any crash on Windows. Can you provide a patch?

— Reply to this email directly, view it on GitHub https://github.com/stoermelder/vcvrack-packone/issues/297#issuecomment-1315816881, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3ZRBNEBIS24DKYQPJ3SKTWIPVUBANCNFSM5IYMRDXA . You are receiving this because you commented.Message ID: @.***>

ContemporaryInsanity commented 1 year ago

Pretty sure you're missing checking mw.

ModuleWidget *mw = APP->scene->rack->getModule(m->rightExpander.moduleId); if(!mw) return;

stoermelder commented 1 year ago

Yeah, you are most probably right. Added the fix, please let me know if crashes still happen.

higaru2 commented 1 year ago

Ben: where to get the new builds to try!? its not on the usual place: https://github.com/stoermelder/vcvrack-packone/releases/tag/Nightly

thnx

On Tue, Nov 15, 2022 at 10:44 PM Ben @.***> wrote:

Yeah, you are most probably right. Added the fix, please let me know if crashes still happen.

— Reply to this email directly, view it on GitHub https://github.com/stoermelder/vcvrack-packone/issues/297#issuecomment-1315841358, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3ZRBJHNQ33QCQKJQNIV2LWIPY4VANCNFSM5IYMRDXA . You are receiving this because you commented.Message ID: @.***>

stoermelder commented 1 year ago

Looks like the build enviroment is under maintenance at the moment. I will retry the build later. Sorry for that.

ContemporaryInsanity commented 1 year ago

Looks like we've fixed it :)