AScustomWorks / AS

VCV Rack Modules
Other
114 stars 16 forks source link

Rack v1: Crash when loading modules in module browser #42

Closed cschol closed 5 years ago

cschol commented 5 years ago

Backtrace on Ubuntu 18.04:

Thread 1 "Rack" received signal SIGSEGV, Segmentation fault.
0x00007fffec46f4b1 in MsDisplayWidget::draw (this=0x555557019710, args=...) at src/DelayPlusStereo.cpp:365
365         to_display << std::right  << std::setw(5) << *value;
(gdb) bt
#0  0x00007fffec46f4b1 in MsDisplayWidget::draw(rack::widget::Widget::DrawArgs const&) (this=0x555557019710, args=...) at src/DelayPlusStereo.cpp:365
#1  0x000055555578d209 in rack::widget::Widget::draw(rack::widget::Widget::DrawArgs const&) (this=this@entry=0x555556f70260, args=...) at src/widget/Widget.cpp:174
#2  0x00005555557795df in rack::app::ModuleWidget::draw(rack::widget::Widget::DrawArgs const&) (this=0x555556f70260, args=...) at src/app/ModuleWidget.cpp:259
#3  0x000055555578d209 in rack::widget::Widget::draw(rack::widget::Widget::DrawArgs const&) (this=this@entry=0x555556f701f0, args=...) at src/widget/Widget.cpp:174
#4  0x000055555578c072 in rack::widget::ZoomWidget::draw(rack::widget::Widget::DrawArgs const&) (this=0x555556f701f0, args=...) at src/widget/ZoomWidget.cpp:38
#5  0x000055555578d209 in rack::widget::Widget::draw(rack::widget::Widget::DrawArgs const&) (this=this@entry=0x555556f70140, args=...) at src/widget/Widget.cpp:174
#6  0x000055555578b6a7 in rack::widget::FramebufferWidget::drawFramebuffer() (this=0x555556f70140) at src/widget/FramebufferWidget.cpp:187
#7  0x000055555578bb48 in rack::widget::FramebufferWidget::step() (this=0x555556f70140) at src/widget/FramebufferWidget.cpp:79
#8  0x000055555578dd08 in rack::widget::Widget::step() (this=0x555556285650) at src/widget/Widget.cpp:151
#9  0x000055555578dd08 in rack::widget::Widget::step() (this=0x5555562855e0) at src/widget/Widget.cpp:151
#10 0x000055555578dd08 in rack::widget::Widget::step() (this=this@entry=0x555556282da0) at src/widget/Widget.cpp:151
#11 0x000055555574abba in rack::ui::SequentialLayout::step() (this=0x555556282da0) at src/ui/SequentialLayout.cpp:14
#12 0x000055555578dd08 in rack::widget::Widget::step() (this=this@entry=0x55555627fd40) at src/widget/Widget.cpp:151
#13 0x000055555574ab11 in rack::ui::MarginLayout::step() (this=0x55555627fd40) at src/ui/MarginLayout.cpp:10
#14 0x000055555578dd08 in rack::widget::Widget::step() (this=0x55555627fca0) at src/widget/Widget.cpp:151
#15 0x000055555578dd08 in rack::widget::Widget::step() (this=this@entry=0x555556282c90) at src/widget/Widget.cpp:151
#16 0x000055555574be16 in rack::ui::ScrollWidget::step() (this=0x555556282c90) at src/ui/ScrollWidget.cpp:36
#17 0x000055555578dd08 in rack::widget::Widget::step() (this=0x555556288310) at src/widget/Widget.cpp:151
#18 0x000055555578dd08 in rack::widget::Widget::step() (this=0x55555627f840) at src/widget/Widget.cpp:151
#19 0x000055555578dd08 in rack::widget::Widget::step() (this=this@entry=0x555555e3ed90) at src/widget/Widget.cpp:151
#20 0x000055555577f98c in rack::app::Scene::step() (this=0x555555e3ed90) at src/app/Scene.cpp:51
#21 0x000055555573ad59 in rack::Window::run() (this=0x555555e67450) at src/window.cpp:363
#22 0x00005555556b44f5 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:185
AScustomWorks commented 5 years ago

Thanks, can't test on Linux right now, but I think I found the error (missing NULL declaration to avoid the module browser crash): https://github.com/AScustomWorks/AS/commit/dd1d381866c32cfa33b6af9ddd9d4ff55a61b042

cschol commented 5 years ago

I'll test it. Thanks.

cschol commented 5 years ago

That fixes it. Thanks.

Coirt commented 5 years ago

There might be a few couple more BPMcalc: @AScustomWorks

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000067eba94e in std::operator<< <char, std::char_traits<char>, std::allocator<char> > (__str=..., __os=...)
    at C:/msys64/mingw64/include/c++/8.2.1/bits/basic_string.h:6323
6323        operator<<(basic_ostream<_CharT, _Traits>& __os,
(gdb) bt
#0  0x0000000067eba94e in std::operator<< <char, std::char_traits<char>, std::allocator<char> > (__str=..., __os=...)
    at C:/msys64/mingw64/include/c++/8.2.1/bits/basic_string.h:6323
#1  TempodisplayWidget::draw (this=0x2e314cd0, args=...)
    at src/BPMCalc.cpp:344
#2  0x00000000004a2388 in rack::widget::Widget::draw (
    this=this@entry=0x2e321860, args=...) at src/widget/Widget.cpp:174
#3  0x000000000048e3cb in rack::app::ModuleWidget::draw (this=0x2e321860,
    args=...) at src/app/ModuleWidget.cpp:259
#4  0x00000000004a2388 in rack::widget::Widget::draw (this=0x2e3217a0,
    args=...) at src/widget/Widget.cpp:174
#5  0x00000000004a2f0f in rack::widget::ZoomWidget::draw (this=0x2e3217a0,
    args=...) at src/widget/ZoomWidget.cpp:38
#6  0x00000000004a2388 in rack::widget::Widget::draw (
    this=this@entry=0x2e3216a0, args=...) at src/widget/Widget.cpp:174
#7  0x00000000004a3a2b in rack::widget::FramebufferWidget::drawFramebuffer (
    this=0x2e3216a0) at src/widget/FramebufferWidget.cpp:187
#8  0x00000000004a32fa in rack::widget::FramebufferWidget::step (
    this=0x2e3216a0) at src/widget/FramebufferWidget.cpp:79
#9  0x00000000004a2bd7 in rack::widget::Widget::step (this=0x6d461c0)
    at src/widget/Widget.cpp:151
#10 0x00000000004a2bd7 in rack::widget::Widget::step (this=0x6d46120)
    at src/widget/Widget.cpp:151
#11 0x00000000004a2bd7 in rack::widget::Widget::step (
    this=this@entry=0x6d3cb60) at src/widget/Widget.cpp:151
#12 0x00000000004a11fb in rack::ui::SequentialLayout::step (this=0x6d3cb60)
    at src/ui/SequentialLayout.cpp:14
#13 0x00000000004a2bd7 in rack::widget::Widget::step (
    this=this@entry=0x6d3ca90) at src/widget/Widget.cpp:151
#14 0x000000000049f0dd in rack::ui::MarginLayout::step (this=0x6d3ca90)
    at src/ui/MarginLayout.cpp:10
#15 0x00000000004a2bd7 in rack::widget::Widget::step (this=0x6d3c7e0)
    at src/widget/Widget.cpp:151
#16 0x00000000004a2bd7 in rack::widget::Widget::step (
    this=this@entry=0x6d3c750) at src/widget/Widget.cpp:151
#17 0x000000000049ead3 in rack::ui::ScrollWidget::step (this=0x6d3c750)
    at src/ui/ScrollWidget.cpp:36
#18 0x00000000004a2bd7 in rack::widget::Widget::step (this=0x6d3bd50)
    at src/widget/Widget.cpp:151
#19 0x00000000004a2bd7 in rack::widget::Widget::step (this=0x6d3bce0)
    at src/widget/Widget.cpp:151
#20 0x00000000004a2bd7 in rack::widget::Widget::step (this=0x6cc70d0)
    at src/widget/Widget.cpp:151
#21 0x000000000048e0c4 in rack::app::Scene::step (this=0x6cc70d0)
    at src/app/Scene.cpp:51
#22 0x0000000000454bf0 in rack::Window::run (this=0x6cd3450)
    at src/window.cpp:363
#23 0x000000000079c7dd in main (argc=<optimized out>, argv=<optimized out>)
    at src/main.cpp:175
(gdb) make: *** [Makefile:64: debug] Interrupt
cschol commented 5 years ago

@Coirt Is this in the module browser or when the module is running?

Coirt commented 5 years ago

Browser

cschol commented 5 years ago

Confirmed. It is seemingly timing related whether the crash occurs. A few times I got it to work...but it is definitely an issue. Thanks for reporting.

cschol commented 5 years ago

This should do it:

diff --git a/src/BPMCalc.cpp b/src/BPMCalc.cpp
index f8a353a..30d15f4 100755
--- a/src/BPMCalc.cpp
+++ b/src/BPMCalc.cpp
@@ -312,7 +312,7 @@ struct BPMCalc : Module {

 ////////////////////////////////////
 struct TempodisplayWidget : TransparentWidget {
-  std::string *value;
+  std::string *value = NULL;
   std::shared_ptr<Font> font;

   TempodisplayWidget() {
@@ -634,4 +634,4 @@ struct BPMCalcWidget : ModuleWidget {
 };

-Model *modelBPMCalc = createModel<BPMCalc, BPMCalcWidget>("BPMCalc");
\ No newline at end of file
+Model *modelBPMCalc = createModel<BPMCalc, BPMCalcWidget>("BPMCalc");
diff --git a/src/BPMCalc2.cpp b/src/BPMCalc2.cpp
index 62d9d2d..08995a0 100755
--- a/src/BPMCalc2.cpp
+++ b/src/BPMCalc2.cpp
@@ -312,7 +312,7 @@ struct BPMCalc2 : Module {

 ////////////////////////////////////
 struct TempodisplayWidget : TransparentWidget {
- std::string *value;
+ std::string *value = NULL;
   std::shared_ptr<Font> font;

   TempodisplayWidget() {
@@ -425,4 +425,4 @@ struct BPMCalc2Widget : ModuleWidget {
 };

-Model *modelBPMCalc2 = createModel<BPMCalc2, BPMCalc2Widget>("BPMCalc2");
\ No newline at end of file
+Model *modelBPMCalc2 = createModel<BPMCalc2, BPMCalc2Widget>("BPMCalc2");
Coirt commented 5 years ago

Interesting, yeah confirmed now loading! :sake:

AScustomWorks commented 5 years ago

Oh, missed those two. fixed now: https://github.com/AScustomWorks/AS/commit/15e89652b788e0c4c17b1a74377628a98424ea5e And added "Distortion" tag to the Overdrive FX module in plugin.json https://github.com/AScustomWorks/AS/commit/730c76405a5f21c817df62c90537484cfa83b8a7

cschol commented 5 years ago

Thanks!

Coirt commented 5 years ago

Seems fixed :+1: