Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eugene crashes when selecting a preset via Stoermelder 8facemk2 #3

Closed
chinenual opened this issue Feb 15, 2023 · 1 comment
Closed

Comments

@chinenual
Copy link

I am getting a consistent crash whenever I try to use 8face to preserve Eugene state. I can "record" a preset, but whenever I try to playback one of the recorded presets, it crashes rack.

How to reproduce:
Use the attached vcv patch. Click 8face's R/W toggle to "w". Press the first green button (.). Clock the R/W toggle back to "r". The press the first green button to "recall" the preset you just saved. Boom!

A representative crash:

Thread 7 Crashed:
0   libGL.dylib                   	    0x7ffa29acb78f glDeleteFramebuffers + 18
1   libRack.dylib                 	       0x1020b04b6 nvgluDeleteFramebuffer(NVGLUframebuffer*) + 38
2   libRack.dylib                 	       0x10218b996 rack::widget::FramebufferWidget::~FramebufferWidget() + 54
3   libRack.dylib                 	       0x10218ba9e rack::widget::FramebufferWidget::~FramebufferWidget() + 14
4   libRack.dylib                 	       0x10218cf91 rack::widget::Widget::clearChildren() + 113
5   libRack.dylib                 	       0x10218ce66 rack::widget::Widget::~Widget() + 38
6   libRack.dylib                 	       0x10214f2a8 rack::app::SvgPanel::~SvgPanel() + 72
7   libRack.dylib                 	       0x10212d3b1 rack::app::ModuleWidget::setPanel(std::__1::shared_ptr<rack::window::Svg>) + 161
8   plugin.dylib                  	       0x10d9dc05d OrbitsWidget::loadTheme(int) + 189
9   plugin.dylib                  	       0x10d9dc3ac OrbitsWidget::loadTheme(char const*) + 204
10  libRack.dylib                 	       0x10217d6ef rack::engine::Module::fromJson(json_t*) + 735
11  libRack.dylib                 	       0x102178990 rack::engine::Engine::moduleFromJson(rack::engine::Module*, json_t*) + 48
12  plugin.dylib                  	       0x10a272260 StoermelderPackOne::EightFaceMk2::EightFaceMk2Module<8>::processWorker(int) + 944
13  plugin.dylib                  	       0x10a27111f StoermelderPackOne::TaskWorker::processWorker() + 127
14  plugin.dylib                  	       0x10a2712fe void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (StoermelderPackOne::TaskWorker::*)(), StoermelderPackOne::TaskWorker*> >(void*) + 62
15  libsystem_pthread.dylib       	    0x7ff810abd4e1 _pthread_start + 125
16  libsystem_pthread.dylib       	    0x7ff810ab8f6b thread_start + 15

eugene.vcv.zip

@RareBreeds
Copy link
Owner

Hello! Thanks for the detailed bug report.

Looks like it crashed because 8face calls moduleFromJson from a thread other than the main thread. My JSON has the module's theme in it so ends up calling GL functions, which you're not allowed to call from other threads.

Just noticed the 8face docs warn about potential crashes, but it wasn't too difficult to prevent the crash once I figured out what was going on... and modulating between different presets does sound useful.

https://github.com/stoermelder/vcvrack-packone/blob/v2/docs/EightFaceMk2.md

Disclaimer: Loading presets of modules was not designed to be controlled by CV or modulated at audio rate. Please do not contact the developers of Rack or any modules when unexpected behaviour occurs (i.e. crashes) or high CPU usage is noticeable.

RareBreeds added a commit that referenced this issue Jul 3, 2023
8FaceMk2 will call dataFromJson from a thread other than the main one.
Eugene/Polygene load widget themes from the JSON which modifies GL state.
GL state can only be modified on the main thread or we may crash.

Resolves #3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants