v2 Module Browser crash if light is included / Fresh linux V2 Install w/ Fundamental crashes when module browser opens

Hello,

I’ve been working on this ‘Circle’ module of mine for quite a while now, and wish to release it soon. I’m trying to update to v2, but I am stuck on this one bug I am not sure how to fix.

When I include this line of code in my CircleWidget(Circle *module) constructor

 addChild(createLight<MediumLight<RedGreenBlueLight>>(mm2px(Vec(28.315, 81.481)), module, Circle::CYCLE_LIGHT));

Then Rack crashes on opening the module browser at line 111 here:

107 void ModuleLightWidget::step() {
108     std::vector<float> brightnesses(baseColors.size());
109
110     if (module && firstLightId >= 0) {
111         assert((int) module->lights.size() >= firstLightId + (int) baseColors.size());

Thread 1 "Rack" received signal SIGSEGV, Segmentation fault. rack::app::ModuleLightWidget::step (this=0x555556074ed0) at src/app/ModuleLightWidget.cpp:111 111 assert((int) module->lights.size() >= firstLightId + (int) baseColors.size());

I have no idea what to do. It seems as if module passes the if check, but leads to a segfault.

Any help would be appreciated :pray:

EDIT:

It seems the real problem is that Rackv2 builds but breaks when the module browser is opened.

In the browser module should be nullptr. That is the source of the problem.

Any way I can check if it is in module browser mode and set the module to nullptr? I think previously the constructor was called with a nullptr module.

This is my code and it is still broke.

struct CircleWidget : ModuleWidget {
  const int hp = 6;

  CircleWidget(Circle *module) {
    setModule(module);
    box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT);
    setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Circle.svg")));

    addChild(createLight<MediumLight<RedGreenBlueLight>>(mm2px(Vec(28.315, 81.481)), module, Circle::CYCLE_LIGHT));
  }
};


This sound very odd. You are saying that your widget is getting passed a non null module pointer, but it seems to be bogus? That would crash almost vcv plugin. I don’t think I believe that.

It’s very odd and I need help, I’m not sure where else to look for bugs.

I have no idea.

I tried building Rackv2 with just the v2 Fundamental in the plugins folder and I am running into the same problem.

It runs, but module browser crashes

With same error

Thread 1 "Rack" received signal SIGSEGV, Segmentation fault.
rack::app::ModuleLightWidget::step (this=0x555555ecbf10) at src/app/ModuleLightWidget.cpp:111
111                     assert((int) module->lights.size() >= firstLightId + (int) baseColors.size());

Relevant info:

 ϻ › uname -a                                                                   Soft/Rack v2
Linux zen 5.10.70-1-MANJARO #1 SMP PREEMPT Thu Sep 30 15:29:01 UTC 2021 x86_64 GNU/Linux

Here’s me trying to build a fresh Rackv2 with Fundamental

2 questions:

  1. What VCV version do you use?
  2. Is your code open source, so I could download and try to reproduce your error?

I though OP just said it reproduces with stock rack and fundamentals. Of course thousands of us have built and run these. What OS is this? What version of gcc? And, as you ask, which versions of vcv.

Oh, Linux……

If you just want to build your plugins without crashing, use the rack build toolchain. If you want to find and log a bug in VCV run under address sanitizer and find out what’s going wrong.

This is a 4 month old thread…

2 Likes