wolf-plugins / wolf-shaper

Waveshaper plugin with a spline-based graph editor (LV2, VST, and CLAP)
https://wolf-plugins.github.io/wolf-shaper/
GNU General Public License v3.0
218 stars 19 forks source link

make DEBUG=true results in segfault #53

Closed rghvdberg closed 6 years ago

rghvdberg commented 6 years ago

BUILD_VST2=true BUILD_LV2=true BUILD_DSSI=true BUILD_JACK=true make DEBUG=true here's the output of gdb bin/wolf-shaper

Starting program: /home/rob/git/wolf-shaper/bin/wolf-shaper 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff7f26700 (LWP 18904)]
[New Thread 0x7ffff7ea5700 (LWP 18905)]

Thread 1 "wolf-shaper" received signal SIGSEGV, Segmentation fault.
0x0000000000489ffe in fons__allocFont (stash=0x4e77d0 <virtual thunk to std::basic_fstream<char, std::char_traits<char> >::~basic_fstream()>) at src/nanovg/fontstash.h:829
829         stash->cfonts = stash->cfonts == 0 ? 8 : stash->cfonts * 2;

Thread 3 (Thread 0x7ffff7ea5700 (LWP 18905)):
#0  0x00007ffff734451d in read () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff7114b95 in ?? () from /usr/lib/x86_64-linux-gnu/libjack.so.0
#2  0x00007ffff711893c in ?? () from /usr/lib/x86_64-linux-gnu/libjack.so.0
#3  0x00007ffff71133b0 in ?? () from /usr/lib/x86_64-linux-gnu/libjack.so.0
#4  0x00007ffff733b6ba in start_thread (arg=0x7ffff7ea5700) at pthread_create.c:333
#5  0x00007ffff6b1241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7ffff7f26700 (LWP 18904)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff71141dc in ?? () from /usr/lib/x86_64-linux-gnu/libjack.so.0
#2  0x00007ffff7106f08 in ?? () from /usr/lib/x86_64-linux-gnu/libjack.so.0
#3  0x00007ffff71133b0 in ?? () from /usr/lib/x86_64-linux-gnu/libjack.so.0
#4  0x00007ffff733b6ba in start_thread (arg=0x7ffff7f26700) at pthread_create.c:333
#5  0x00007ffff6b1241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7ffff7f28900 (LWP 18900)):
#0  0x0000000000489ffe in fons__allocFont (stash=0x4e77d0 <virtual thunk to std::basic_fstream<char, std::char_traits<char> >::~basic_fstream()>) at src/nanovg/fontstash.h:829
#1  0x000000000048a263 in fonsAddFontMem (stash=0x4e77d0 <virtual thunk to std::basic_fstream<char, std::char_traits<char> >::~basic_fstream()>, name=0x554dd8 "roboto_light", data=0x555720 <temp1> "", dataSize=187036, freeData=0)
    at src/nanovg/fontstash.h:886
#2  0x00000000004a55b0 in nvgCreateFontMem (ctx=0x881480 <vtable for SPOONIE_DGL::NanoWidget+112>, name=0x554dd8 "roboto_light", data=0x555720 <temp1> "", ndata=187036, freeData=0) at src/nanovg/nanovg.c:2164
#3  0x00000000004825cc in SPOONIE_DGL::NanoVG::createFontFromMemory (this=0xaddd58, name=0x554dd8 "roboto_light", data=0x555720 <temp1> "", dataSize=187036, freeData=false) at src/NanoVG.cpp:774
#4  0x000000000045bfe2 in WOLF_SHAPER_DISTRHO::GraphWidget::GraphWidget(WOLF_SHAPER_DISTRHO::WaveShaperUI*) ()
#5  0x000000000045c564 in WOLF_SHAPER_DISTRHO::GraphWidgetSocket::GraphWidgetSocket(WOLF_SHAPER_DISTRHO::WaveShaperUI*) ()
#6  0x00000000004657cb in WOLF_SHAPER_DISTRHO::WaveShaperUI::WaveShaperUI (this=0xa21a80) at WaveShaperUI.cpp:21
#7  0x00000000004668be in WOLF_SHAPER_DISTRHO::createUI () at WaveShaperUI.cpp:204
#8  0x00000000004678d1 in WOLF_SHAPER_DISTRHO::createUiWrapper (dspPtr=0x9115e0, window=0x7fffffffdde8) at ../../dpf/distrho/src/DistrhoUIInternal.hpp:149
#9  0x000000000046925b in WOLF_SHAPER_DISTRHO::UIExporterWindow::UIExporterWindow (this=0x7fffffffdde8, app=..., winId=0, dspPtr=0x9115e0) at ../../dpf/distrho/src/DistrhoUIInternal.hpp:160
#10 0x00000000004694c7 in WOLF_SHAPER_DISTRHO::UIExporter::UIExporter (this=0x7fffffffddd0, ptr=0x7fffffffddb0, winId=0, editParamCall=0x0, 
    setParamCall=0x46a675 <WOLF_SHAPER_DISTRHO::PluginJack::setParameterValueCallback(void*, unsigned int, float)>, setStateCall=0x46a6a8 <WOLF_SHAPER_DISTRHO::PluginJack::setStateCallback(void*, char const*, char const*)>, 
    sendNoteCall=0x0, setSizeCall=0x46a6d6 <WOLF_SHAPER_DISTRHO::PluginJack::setSizeCallback(void*, unsigned int, unsigned int)>, dspPtr=0x9115e0, bundlePath=0x0) at ../../dpf/distrho/src/DistrhoUIInternal.hpp:244
#11 0x000000000046995f in WOLF_SHAPER_DISTRHO::PluginJack::PluginJack (this=0x7fffffffddb0, client=0x911070) at ../../dpf/distrho/src/DistrhoPluginJack.cpp:98
#12 0x0000000000467d05 in main () at ../../dpf/distrho/src/DistrhoPluginJack.cpp:588
pdesaulniers commented 6 years ago

Did you try building it without the debug flag beforehand? If so, did you run make clean before rebuilding it with DEBUG=true?

rghvdberg commented 6 years ago

I tried (and succeeded) building it without the debug flag beforehand, and ran make clean before rebuilding. I was just curious if the debug build would show any useful messages.

pdesaulniers commented 6 years ago

I'm pretty much sure the issue is with make clean not picking up all of the garbage. I'll take a look at this in a few hours.

Also, I don't log anything interesting in the debug version :)

pdesaulniers commented 6 years ago

This should be fixed now. Can you confirm?

pdesaulniers commented 6 years ago

I can't reproduce this anymore, so I'll assume this is fixed.