DISTRHO / DPF

DISTRHO Plugin Framework
ISC License
672 stars 97 forks source link

VST3/CLAP crashes on REAPER for Windows if output with WASAPI #413

Closed AnClark closed 1 year ago

AnClark commented 1 year ago

Hi, falkTX!

I found that both VST3 and CLAP UI will crash REAPER, if I set audio output driver to WASAPI. But everything worked well with ASIO driver.

Related project: Minaton-XT

Here are backtraces:

AnClark commented 1 year ago

Problem still exists on recent versions of my project. Here's backtrace:

(gdb) bt
#0  0x00007ff8bce965a4 in DISTRHO::MinatonPlugin::_processAudioFrame (this=0x13ad9390, audio_l=0x13bb3130,
    audio_r=0x1442b1d0, frame_index=1972) at D:/Sources/minaton/plugin/MinatonProcess.cpp:113
#1  0x00007ff8bce95558 in DISTRHO::MinatonPlugin::run (this=0x13ad9390, inputs=0xcf9c740, outputs=0xcf9c730,
    frames=2048, midiEvents=0x31fbea0, midiEventCount=0) at D:/Sources/minaton/plugin/MinatonPlugin.cpp:154
#2  0x00007ff8bcfafad5 in DISTRHO::PluginExporter::run (this=0x31fbe30, inputs=0xcf9c740, outputs=0xcf9c730,
    frames=2048, midiEvents=0x31fbea0, midiEventCount=0)
    at D:/Sources/minaton/dpf/distrho/src/DistrhoPluginInternal.hpp:964
#3  0x00007ff8bcfaae22 in DISTRHO::PluginVst3::process (this=0x31f4de0, data=0xcf9c900)
    at D:/Sources/minaton/dpf/distrho/src/DistrhoPluginVST3.cpp:1587
#4  0x00007ff8bcfb2e23 in DISTRHO::dpf_audio_processor::process (self=0xa1aab8, data=0xcf9c900)
    at D:/Sources/minaton/dpf/distrho/src/DistrhoPluginVST3.cpp:4116

Notice param frame_index in BT frame #0. It stucks at a strange index number 1972, but audio buffer size is acutally 2048.

falkTX commented 1 year ago

that frame_index has nothing to do with dpf, I suspect this is a bug in the plugin. the 1st post leads me to think it is writing out of bounds and getting memory corrupted.

try running it through valgrind, like described in https://github.com/DISTRHO/Cardinal/blob/main/docs/DEBUGGING.md#plugin-usage (but change CARLA_BRIDGE_DUMMY=30 to CARLA_BRIDGE_DUMMY=1

AnClark commented 1 year ago

OK, I'll debug further.

The bug is reproducible on REAPER with Wine. When WASAPI buffer size is 2048, problem occurs.

falkTX commented 1 year ago

then maybe it is an issue with the plugin with higher buffer sizes, as simple as that. try in linux with such high buffer size too?

AnClark commented 1 year ago

Sure. On REAPER for Linux, with PulseAudio & buffer size of 2048, the same problem occurred.

But at this time, the backtrace is much different:

(gdb) bt
#0  0x00007ffff795483c in  () at /usr/lib/libc.so.6
#1  0x00007ffff7904668 in raise () at /usr/lib/libc.so.6
#2  0x00007ffff78ec4b8 in abort () at /usr/lib/libc.so.6
#3  0x00007ffff78ed390 in  () at /usr/lib/libc.so.6
#4  0x00007ffff795e7b7 in  () at /usr/lib/libc.so.6
#5  0x00007ffff7962f0c in malloc () at /usr/lib/libc.so.6
#6  0x00007fffbc2ceaf6 in  () at /usr/lib/dri/crocus_dri.so
#7  0x00007fffbc7a6042 in  () at /usr/lib/dri/crocus_dri.so
#8  0x00007fffbc2babfd in  () at /usr/lib/dri/crocus_dri.so
#9  0x00007ffff7fcf0fe in  () at /lib64/ld-linux-x86-64.so.2
#10 0x00007ffff7fcf1ec in  () at /lib64/ld-linux-x86-64.so.2
#11 0x00007ffff7fcb56e in _dl_catch_exception () at /lib64/ld-linux-x86-64.so.2
#12 0x00007ffff7fd5ad6 in  () at /lib64/ld-linux-x86-64.so.2
#13 0x00007ffff7fcb4e1 in _dl_catch_exception () at /lib64/ld-linux-x86-64.so.2
#14 0x00007ffff7fd5e4c in  () at /lib64/ld-linux-x86-64.so.2
#15 0x00007ffff794e9ec in  () at /usr/lib/libc.so.6
#16 0x00007ffff7fcb4e1 in _dl_catch_exception () at /lib64/ld-linux-x86-64.so.2
#17 0x00007ffff7fcb603 in  () at /lib64/ld-linux-x86-64.so.2
#18 0x00007ffff794e4f7 in  () at /usr/lib/libc.so.6
#19 0x00007ffff794eaa1 in dlopen () at /usr/lib/libc.so.6
#20 0x00007ffff549b4de in  () at /usr/lib/libGLX_mesa.so.0
#21 0x00007ffff549f1c9 in  () at /usr/lib/libGLX_mesa.so.0
#22 0x00007ffff549f4a3 in  () at /usr/lib/libGLX_mesa.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#23 0x00007ffff5483109 in  () at /usr/lib/libGLX_mesa.so.0
#24 0x00007ffff5483b66 in  () at /usr/lib/libGLX_mesa.so.0
#25 0x00007ffff5483c48 in  () at /usr/lib/libGLX_mesa.so.0
#26 0x00007ffff71cd1c5 in glXChooseFBConfig () at /usr/lib/libGLX.so.0
#27 0x00007fffbeb51dd5 in DGL::puglX11GlConfigure(DGL::PuglView*) (view=0x12bfe80)
    at /home/anclark/Sources/minaton/dpf/dgl/src/pugl-upstream/src/x11_gl.c:72
#28 0x00007fffbeb4d91a in DGL::puglRealize(DGL::PuglViewImpl*) (view=0x12bfe80)
    at /home/anclark/Sources/minaton/dpf/dgl/src/pugl-upstream/src/x11.c:393
#29 0x00007fffbeaf97be in DGL::Window::PrivateData::initPost() (this=0x14e6170)
    at /home/anclark/Sources/minaton/dpf/dgl/src/WindowPrivateData.cpp:282
#30 0x00007fffbeac7057 in DISTRHO::PluginWindow::PluginWindow(DISTRHO::UI*, DISTRHO::PluginApplication&, unsigned long, unsigned int, unsigned int, double)
    (this=0x12c0690, uiPtr=0x12bf960, app=..., parentWindowHandle=0, width=658, height=595, scaleFactor=1)
    at /home/anclark/Sources/minaton/dpf/distrho/src/DistrhoUIPrivateData.hpp:201
#31 0x00007fffbeac6802 in DISTRHO::UI::PrivateData::createNextWindow(DISTRHO::UI*, unsigned int, unsigned int, bool)
    (ui=0x12bf960, width=658, height=595, adjustForScaleFactor=false)
    at /home/anclark/Sources/minaton/dpf/distrho/src/DistrhoUI.cpp:207
#32 0x00007fffbeac68d7 in DISTRHO::UI::UI(unsigned int, unsigned int, bool)
    (this=0x12bf960, width=658, height=595, automaticallyScaleAndSetAsMinimumSize=false)
    at /home/anclark/Sources/minaton/dpf/distrho/src/DistrhoUI.cpp:221
#33 0x00007fffbeacfe02 in DISTRHO::MinatonUI::MinatonUI() (this=0x12bf960)
    at /home/anclark/Sources/minaton/plugin/MinatonUI.cpp:25
#34 0x00007fffbead24b2 in DISTRHO::createUI() ()
    at /home/anclark/Sources/minaton/plugin/MinatonUI.cpp:410
--Type <RET> for more, q to quit, c to continue without paging--
#35 0x00007fffbeab3459 in DISTRHO::UIExporter::UIExporter(void*, unsigned long, double, void (*)(void*, unsigned int, bool), void (*)(void*, unsigned int, float), void (*)(void*, char const*, char const*), void (*)(void*, unsigned char, unsigned char, unsigned char), void (*)(void*, unsigned int, unsigned int), bool (*)(void*, char const*), char const*, void*, double, unsigned int, unsigned int, char const*)
    (this=0x7fffffff0340, callbacksPtr=0x0, winId=0, sampleRate=48000, editParamCall=0x0, setParamCall=0x0, setStateCall=0x0, sendNoteCall=0x0, setSizeCall=0x0, fileRequestCall=0x0, bundlePath=0x1fd29d0 "/home/anclark/Sources/minaton/build/bin/minaton.clap", dspPtr=0x229a890, scaleFactor=1, bgColor=0, fgColor=4294967295, appClassName=0x0)
    at /home/anclark/Sources/minaton/dpf/distrho/src/DistrhoUIInternal.hpp:89
#36 0x00007fffbeab4103 in DISTRHO::ClapUI::getSize(unsigned int*, unsigned int*) const
    (this=0x1fbdfe0, width=0x7fffffff03c8, height=0x7fffffff03cc)
    at /home/anclark/Sources/minaton/dpf/distrho/src/DistrhoPluginCLAP.cpp:290
#37 0x00007fffbeaaf134 in DISTRHO::clap_gui_get_size(clap_plugin_t const*, uint32_t*, uint32_t*) (plugin=0x1fc1880, width=0x7fffffff03c8, height=0x7fffffff03cc)
    at /home/anclark/Sources/minaton/dpf/distrho/src/DistrhoPluginCLAP.cpp:2130

Glibc reports:

corrupted double-linked list
[1]    15010 IOT instruction (core dumped)  reaper
AnClark commented 1 year ago

I've found out why my plugin crashes with 2048 samples on Windows.

I implement bufferSizeChanged() so that if buffer size changes, I can reallocate my resampler buffer. But, REAPER does not invoke this method on buffer size changes.

falkTX commented 1 year ago

I would be very surprised if that is the case. it is more likely that the buffer size is correct from the start, and thus never needs to change. You can always call that manually yourself during init, like bufferSizeChanged(getBufferSize()).

Basically, that is a callback for when things change. If the initial conditions do not change, there is no callback.

falkTX commented 1 year ago

and regarding your backtrace. you very much likely have corrupted memory, which invalidates any possible debug afterwards. so you need to prevent memory from being corrupted in the first place, valgrind helps for finding where. also latest clang and gcc have built-in flags for similar things, called ASAN.

AnClark commented 1 year ago

Thanks a lot!

Sounds like corrupted memory cause many weird things.

Besides using Valgrind, I also tried to use new and delete rather than malloc() and free(). Sounds like sometimes Glibc malloc() may have bugs occasionally.

BTW, I already have a similar function initResampler() (my own API) called. bufferSizeChanged() invokes initResampler().

falkTX commented 1 year ago

Sounds like sometimes Glibc malloc() may have bugs occasionally.

it 100% does not. otherwise all software would randomly break. dont assume the external libs to have problems before confirming issues in the local code.

and yes, memory corruption will turn everything into undefined and weird state. you cant assume the program to continue to work in any reliable way if any of its memory gets corrupted, it is too late after that

AnClark commented 1 year ago

Thanks! I checked my plugin with Valgrind, and it reported a bunch of memory leak issues.

A section of Valgrind report ```log Try to use PulseAudio with buffer size 2048, then load CLAPi Minaton. [DSP] Sample rate changed: from 44100.000000 to 48000.000000 ==2288== Thread 5 reaper/audio: ==2288== Conditional jump or move depends on uninitialised value(s) ==2288== at 0x280F3097: DISTRHO::MinatonPlugin::_processAudioFrame(float*, float*, unsigned int) (MinatonProcess.cpp:65) ==2288== by 0x280F2124: DISTRHO::MinatonPlugin::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (MinatonPlugin.cpp:156) ==2288== by 0x280DC8C8: DISTRHO::PluginExporter::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (DistrhoPluginInternal.hpp:964) ==2288== by 0x280DFA25: DISTRHO::PluginCLAP::process(clap_process const*) (DistrhoPluginCLAP.cpp:1077) ==2288== by 0x280D99FC: DISTRHO::clap_plugin_process(clap_plugin const*, clap_process const*) (DistrhoPluginCLAP.cpp:2447) ==2288== by 0xB7A998: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7C5AC9: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79B0FD: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79FB42: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72A8AE: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== ==2288== Invalid write of size 4 ==2288== at 0x280F37B2: DISTRHO::MinatonPlugin::_processAudioFrame(float*, float*, unsigned int) (MinatonProcess.cpp:113) ==2288== by 0x280F2124: DISTRHO::MinatonPlugin::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (MinatonPlugin.cpp:156) ==2288== by 0x280DC8C8: DISTRHO::PluginExporter::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (DistrhoPluginInternal.hpp:964) ==2288== by 0x280DFA25: DISTRHO::PluginCLAP::process(clap_process const*) (DistrhoPluginCLAP.cpp:1077) ==2288== by 0x280D99FC: DISTRHO::clap_plugin_process(clap_plugin const*, clap_process const*) (DistrhoPluginCLAP.cpp:2447) ==2288== by 0xB7A998: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7C5AC9: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79B0FD: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79FB42: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72A8AE: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== Address 0x6a39090 is 0 bytes after a block of size 4,096 alloc'd ==2288== at 0x4841848: malloc (vg_replace_malloc.c:431) ==2288== by 0x280F25EC: DISTRHO::MinatonPlugin::reinitResampler(unsigned int, unsigned int) (MinatonPlugin.cpp:241) ==2288== by 0x280F24B3: DISTRHO::MinatonPlugin::sampleRateChanged(double) (MinatonPlugin.cpp:217) ==2288== by 0x280DCBD9: DISTRHO::PluginExporter::setSampleRate(double, bool) (DistrhoPluginInternal.hpp:1032) ==2288== by 0x280DF106: DISTRHO::PluginCLAP::activate(double, unsigned int) (DistrhoPluginCLAP.cpp:807) ==2288== by 0x280D997A: DISTRHO::clap_plugin_activate(clap_plugin const*, double, unsigned int, unsigned int) (DistrhoPluginCLAP.cpp:2418) ==2288== by 0xB788FB: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7E716: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7F122: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7CF0C1: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79E2A4: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x77A883: ??? (in /usr/lib/REAPER/reaper) ==2288== ==2288== Invalid write of size 4 ==2288== at 0x280F3805: DISTRHO::MinatonPlugin::_processAudioFrame(float*, float*, unsigned int) (MinatonProcess.cpp:114) ==2288== by 0x280F2124: DISTRHO::MinatonPlugin::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (MinatonPlugin.cpp:156) ==2288== by 0x280DC8C8: DISTRHO::PluginExporter::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (DistrhoPluginInternal.hpp:964) ==2288== by 0x280DFA25: DISTRHO::PluginCLAP::process(clap_process const*) (DistrhoPluginCLAP.cpp:1077) ==2288== by 0x280D99FC: DISTRHO::clap_plugin_process(clap_plugin const*, clap_process const*) (DistrhoPluginCLAP.cpp:2447) ==2288== by 0xB7A998: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7C5AC9: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79B0FD: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79FB42: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72A8AE: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== Address 0xa750430 is 0 bytes after a block of size 4,096 alloc'd ==2288== at 0x4841848: malloc (vg_replace_malloc.c:431) ==2288== by 0x280F2609: DISTRHO::MinatonPlugin::reinitResampler(unsigned int, unsigned int) (MinatonPlugin.cpp:242) ==2288== by 0x280F24B3: DISTRHO::MinatonPlugin::sampleRateChanged(double) (MinatonPlugin.cpp:217) ==2288== by 0x280DCBD9: DISTRHO::PluginExporter::setSampleRate(double, bool) (DistrhoPluginInternal.hpp:1032) ==2288== by 0x280DF106: DISTRHO::PluginCLAP::activate(double, unsigned int) (DistrhoPluginCLAP.cpp:807) ==2288== by 0x280D997A: DISTRHO::clap_plugin_activate(clap_plugin const*, double, unsigned int, unsigned int) (DistrhoPluginCLAP.cpp:2418) ==2288== by 0xB788FB: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7E716: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7F122: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7CF0C1: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79E2A4: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x77A883: ??? (in /usr/lib/REAPER/reaper) ==2288== ==2288== Invalid read of size 4 ==2288== at 0x285366ED: linear_vari_process (src_linear.c:123) ==2288== by 0x280F21B1: DISTRHO::MinatonPlugin::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (MinatonPlugin.cpp:171) ==2288== by 0x280DC8C8: DISTRHO::PluginExporter::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (DistrhoPluginInternal.hpp:964) ==2288== by 0x280DFA25: DISTRHO::PluginCLAP::process(clap_process const*) (DistrhoPluginCLAP.cpp:1077) ==2288== by 0x280D99FC: DISTRHO::clap_plugin_process(clap_plugin const*, clap_process const*) (DistrhoPluginCLAP.cpp:2447) ==2288== by 0xB7A998: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7C5AC9: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79B0FD: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79FB42: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72A8AE: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== Address 0x6a39090 is 0 bytes after a block of size 4,096 alloc'd ==2288== at 0x4841848: malloc (vg_replace_malloc.c:431) ==2288== by 0x280F25EC: DISTRHO::MinatonPlugin::reinitResampler(unsigned int, unsigned int) (MinatonPlugin.cpp:241) ==2288== by 0x280F24B3: DISTRHO::MinatonPlugin::sampleRateChanged(double) (MinatonPlugin.cpp:217) ==2288== by 0x280DCBD9: DISTRHO::PluginExporter::setSampleRate(double, bool) (DistrhoPluginInternal.hpp:1032) ==2288== by 0x280DF106: DISTRHO::PluginCLAP::activate(double, unsigned int) (DistrhoPluginCLAP.cpp:807) ==2288== by 0x280D997A: DISTRHO::clap_plugin_activate(clap_plugin const*, double, unsigned int, unsigned int) (DistrhoPluginCLAP.cpp:2418) ==2288== by 0xB788FB: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7E716: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7F122: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7CF0C1: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79E2A4: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x77A883: ??? (in /usr/lib/REAPER/reaper) ==2288== ==2288== Invalid read of size 4 ==2288== at 0x285366E8: linear_vari_process (src_linear.c:122) ==2288== by 0x280F21B1: DISTRHO::MinatonPlugin::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (MinatonPlugin.cpp:171) ==2288== by 0x280DC8C8: DISTRHO::PluginExporter::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (DistrhoPluginInternal.hpp:964) ==2288== by 0x280DFA25: DISTRHO::PluginCLAP::process(clap_process const*) (DistrhoPluginCLAP.cpp:1077) ==2288== by 0x280D99FC: DISTRHO::clap_plugin_process(clap_plugin const*, clap_process const*) (DistrhoPluginCLAP.cpp:2447) ==2288== by 0xB7A998: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7C5AC9: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79B0FD: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79FB42: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72A8AE: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== Address 0x6a39090 is 0 bytes after a block of size 4,096 alloc'd ==2288== at 0x4841848: malloc (vg_replace_malloc.c:431) ==2288== by 0x280F25EC: DISTRHO::MinatonPlugin::reinitResampler(unsigned int, unsigned int) (MinatonPlugin.cpp:241) ==2288== by 0x280F24B3: DISTRHO::MinatonPlugin::sampleRateChanged(double) (MinatonPlugin.cpp:217) ==2288== by 0x280DCBD9: DISTRHO::PluginExporter::setSampleRate(double, bool) (DistrhoPluginInternal.hpp:1032) ==2288== by 0x280DF106: DISTRHO::PluginCLAP::activate(double, unsigned int) (DistrhoPluginCLAP.cpp:807) ==2288== by 0x280D997A: DISTRHO::clap_plugin_activate(clap_plugin const*, double, unsigned int, unsigned int) (DistrhoPluginCLAP.cpp:2418) ==2288== by 0xB788FB: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7E716: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7F122: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7CF0C1: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79E2A4: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x77A883: ??? (in /usr/lib/REAPER/reaper) ==2288== ==2288== Invalid read of size 4 ==2288== at 0x285367E0: linear_vari_process (src_linear.c:144) ==2288== by 0x280F21B1: DISTRHO::MinatonPlugin::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (MinatonPlugin.cpp:171) ==2288== by 0x280DC8C8: DISTRHO::PluginExporter::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (DistrhoPluginInternal.hpp:964) ==2288== by 0x280DFA25: DISTRHO::PluginCLAP::process(clap_process const*) (DistrhoPluginCLAP.cpp:1077) ==2288== by 0x280D99FC: DISTRHO::clap_plugin_process(clap_plugin const*, clap_process const*) (DistrhoPluginCLAP.cpp:2447) ==2288== by 0xB7A998: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7C5AC9: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79B0FD: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79FB42: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72A8AE: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== Address 0x6a3a08c is 4 bytes before a block of size 3 free'd ==2288== at 0x484412F: free (vg_replace_malloc.c:974) ==2288== by 0x537781E: UnknownInlinedFun (fccfg.c:1754) ==2288== by 0x537781E: FcConfigSubstituteWithPat (fccfg.c:2158) ==2288== by 0x54440A2: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x646227: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x647DE0: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x5447B1F: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x5447A4A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x544C690: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x5E4EB86: UnknownInlinedFun (gdkevents.c:73) ==2288== by 0x5E4EB86: _gdk_event_emit (gdkevents.c:67) ==2288== by 0x5E60981: _gdk_window_process_updates_recurse_helper.lto_priv.0 (gdkwindow.c:3874) ==2288== by 0x5E64FD7: gdk_window_process_updates_internal (gdkwindow.c:4020) ==2288== by 0x5E651F4: UnknownInlinedFun (gdkwindow.c:4215) ==2288== by 0x5E651F4: gdk_window_process_updates_with_mode.lto_priv.0 (gdkwindow.c:4186) ==2288== Block was alloc'd at ==2288== at 0x4841848: malloc (vg_replace_malloc.c:431) ==2288== by 0x4DA53EE: strdup (strdup.c:42) ==2288== by 0x53731D3: UnknownInlinedFun (fcpat.c:103) ==2288== by 0x53731D3: FcConfigEvaluate (fccfg.c:1240) ==2288== by 0x5377766: UnknownInlinedFun (fccfg.c:1709) ==2288== by 0x5377766: FcConfigSubstituteWithPat (fccfg.c:2158) ==2288== by 0x54440A2: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x646227: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x647DE0: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x5447B1F: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x5447A4A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x544C690: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x5E4EB86: UnknownInlinedFun (gdkevents.c:73) ==2288== by 0x5E4EB86: _gdk_event_emit (gdkevents.c:67) ==2288== by 0x5E60981: _gdk_window_process_updates_recurse_helper.lto_priv.0 (gdkwindow.c:3874) ==2288== ==2288== Invalid read of size 4 ==2288== at 0x285366ED: linear_vari_process (src_linear.c:123) ==2288== by 0x280F225A: DISTRHO::MinatonPlugin::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (MinatonPlugin.cpp:179) ==2288== by 0x280DC8C8: DISTRHO::PluginExporter::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (DistrhoPluginInternal.hpp:964) ==2288== by 0x280DFA25: DISTRHO::PluginCLAP::process(clap_process const*) (DistrhoPluginCLAP.cpp:1077) ==2288== by 0x280D99FC: DISTRHO::clap_plugin_process(clap_plugin const*, clap_process const*) (DistrhoPluginCLAP.cpp:2447) ==2288== by 0xB7A998: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7C5AC9: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79B0FD: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79FB42: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72A8AE: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== Address 0xa750430 is 0 bytes after a block of size 4,096 alloc'd ==2288== at 0x4841848: malloc (vg_replace_malloc.c:431) ==2288== by 0x280F2609: DISTRHO::MinatonPlugin::reinitResampler(unsigned int, unsigned int) (MinatonPlugin.cpp:242) ==2288== by 0x280F24B3: DISTRHO::MinatonPlugin::sampleRateChanged(double) (MinatonPlugin.cpp:217) ==2288== by 0x280DCBD9: DISTRHO::PluginExporter::setSampleRate(double, bool) (DistrhoPluginInternal.hpp:1032) ==2288== by 0x280DF106: DISTRHO::PluginCLAP::activate(double, unsigned int) (DistrhoPluginCLAP.cpp:807) ==2288== by 0x280D997A: DISTRHO::clap_plugin_activate(clap_plugin const*, double, unsigned int, unsigned int) (DistrhoPluginCLAP.cpp:2418) ==2288== by 0xB788FB: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7E716: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7F122: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7CF0C1: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79E2A4: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x77A883: ??? (in /usr/lib/REAPER/reaper) ==2288== ==2288== Invalid read of size 4 ==2288== at 0x285366E8: linear_vari_process (src_linear.c:122) ==2288== by 0x280F225A: DISTRHO::MinatonPlugin::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (MinatonPlugin.cpp:179) ==2288== by 0x280DC8C8: DISTRHO::PluginExporter::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (DistrhoPluginInternal.hpp:964) ==2288== by 0x280DFA25: DISTRHO::PluginCLAP::process(clap_process const*) (DistrhoPluginCLAP.cpp:1077) ==2288== by 0x280D99FC: DISTRHO::clap_plugin_process(clap_plugin const*, clap_process const*) (DistrhoPluginCLAP.cpp:2447) ==2288== by 0xB7A998: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7C5AC9: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79B0FD: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79FB42: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72A8AE: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== Address 0xa750430 is 0 bytes after a block of size 4,096 alloc'd ==2288== at 0x4841848: malloc (vg_replace_malloc.c:431) ==2288== by 0x280F2609: DISTRHO::MinatonPlugin::reinitResampler(unsigned int, unsigned int) (MinatonPlugin.cpp:242) ==2288== by 0x280F24B3: DISTRHO::MinatonPlugin::sampleRateChanged(double) (MinatonPlugin.cpp:217) ==2288== by 0x280DCBD9: DISTRHO::PluginExporter::setSampleRate(double, bool) (DistrhoPluginInternal.hpp:1032) ==2288== by 0x280DF106: DISTRHO::PluginCLAP::activate(double, unsigned int) (DistrhoPluginCLAP.cpp:807) ==2288== by 0x280D997A: DISTRHO::clap_plugin_activate(clap_plugin const*, double, unsigned int, unsigned int) (DistrhoPluginCLAP.cpp:2418) ==2288== by 0xB788FB: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7E716: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0xB7F122: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7CF0C1: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79E2A4: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x77A883: ??? (in /usr/lib/REAPER/reaper) ==2288== ==2288== Invalid read of size 4 ==2288== at 0x285367E0: linear_vari_process (src_linear.c:144) ==2288== by 0x280F225A: DISTRHO::MinatonPlugin::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (MinatonPlugin.cpp:179) ==2288== by 0x280DC8C8: DISTRHO::PluginExporter::run(float const**, float**, unsigned int, DISTRHO::MidiEvent const*, unsigned int) (DistrhoPluginInternal.hpp:964) ==2288== by 0x280DFA25: DISTRHO::PluginCLAP::process(clap_process const*) (DistrhoPluginCLAP.cpp:1077) ==2288== by 0x280D99FC: DISTRHO::clap_plugin_process(clap_plugin const*, clap_process const*) (DistrhoPluginCLAP.cpp:2447) ==2288== by 0xB7A998: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7C5AC9: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79B0FD: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x79FB42: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72A8AE: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== Address 0xa75142c is 3,900 bytes inside a block of size 7,392 free'd ==2288== at 0x4846BE0: realloc (vg_replace_malloc.c:1649) ==2288== by 0x58999E2: ft_mem_qrealloc (ftutil.c:156) ==2288== by 0x58B3B1C: Modify_CVT_Check.part.0.lto_priv.0 (ttinterp.c:1476) ==2288== by 0x58A331E: UnknownInlinedFun (ttinterp.c:1469) ==2288== by 0x58A331E: Write_CVT (ttinterp.c:1493) ==2288== by 0x58AA9F1: UnknownInlinedFun (ttinterp.c:3101) ==2288== by 0x58AA9F1: TT_RunIns (ttinterp.c:8136) ==2288== by 0x5893360: UnknownInlinedFun (ttinterp.c:463) ==2288== by 0x5893360: TT_Hint_Glyph (ttgload.c:863) ==2288== by 0x589F51E: UnknownInlinedFun (ttgload.c:1101) ==2288== by 0x589F51E: load_truetype_glyph.lto_priv.0 (ttgload.c:1766) ==2288== by 0x58A4E5C: TT_Load_Glyph.lto_priv.0 (ttgload.c:2880) ==2288== by 0x5898533: FT_Load_Glyph (ftobjs.c:1066) ==2288== by 0x5445952: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x645598: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x645A07: ??? (in /usr/lib/REAPER/reaper) ==2288== Block was alloc'd at ==2288== at 0x4846BE0: realloc (vg_replace_malloc.c:1649) ==2288== by 0x58999E2: ft_mem_qrealloc (ftutil.c:156) ==2288== by 0x58B3B1C: Modify_CVT_Check.part.0.lto_priv.0 (ttinterp.c:1476) ==2288== by 0x58A331E: UnknownInlinedFun (ttinterp.c:1469) ==2288== by 0x58A331E: Write_CVT (ttinterp.c:1493) ==2288== by 0x58AA9F1: UnknownInlinedFun (ttinterp.c:3101) ==2288== by 0x58AA9F1: TT_RunIns (ttinterp.c:8136) ==2288== by 0x5893360: UnknownInlinedFun (ttinterp.c:463) ==2288== by 0x5893360: TT_Hint_Glyph (ttgload.c:863) ==2288== by 0x589F51E: UnknownInlinedFun (ttgload.c:1101) ==2288== by 0x589F51E: load_truetype_glyph.lto_priv.0 (ttgload.c:1766) ==2288== by 0x58A4E5C: TT_Load_Glyph.lto_priv.0 (ttgload.c:2880) ==2288== by 0x5898533: FT_Load_Glyph (ftobjs.c:1066) ==2288== by 0x5445952: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x645598: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x645A07: ??? (in /usr/lib/REAPER/reaper) ==2288== ==2288== Conditional jump or move depends on uninitialised value(s) ==2288== at 0x71E68A: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72BE30: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x8C0638: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x8C5077: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x8C7F2E: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x41ACC5: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x41F37D: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x540BE2A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) ==2288== ==2288== Conditional jump or move depends on uninitialised value(s) ==2288== at 0x71E6C5: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72BE30: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x8C0638: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x8C5077: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x8C7F2E: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x41ACC5: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x41F37D: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x540BE2A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) ==2288== ==2288== Conditional jump or move depends on uninitialised value(s) ==2288== at 0x72D0E5: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7290E4: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x8C0638: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x8C5077: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x8C7F2E: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x41ACC5: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x41F37D: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x540BE2A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) ==2288== ==2288== Thread 6 reaper/mediaafx: ==2288== Conditional jump or move depends on uninitialised value(s) ==2288== at 0x71E6C5: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72BE30: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x73163F: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x6F5D9E: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x540BE2A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) ==2288== ==2288== Conditional jump or move depends on uninitialised value(s) ==2288== at 0x71E68A: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x72BE30: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x73163F: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x6F5D9E: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x540BE2A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) ==2288== ==2288== Conditional jump or move depends on uninitialised value(s) ==2288== at 0x72D0E5: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x730464: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x73163F: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x6F5D9E: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x540BE2A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) ==2288== valgrind: m_mallocfree.c:279 (mk_plain_bszB): Assertion 'bszB != 0' failed. valgrind: This is probably caused by your program erroneously writing past the end of a heap block and corrupting heap metadata. If you fix any invalid writes reported by Memcheck, this assertion failure will probably go away. Please try that before reporting this as a bug. host stacktrace: ==2288== at 0x58042C9A: show_sched_status_wrk (m_libcassert.c:406) ==2288== by 0x58042DC7: report_and_quit (m_libcassert.c:477) ==2288== by 0x58042F6B: vgPlain_assert_fail (m_libcassert.c:543) ==2288== by 0x5804D8C4: mk_plain_bszB (m_mallocfree.c:279) ==2288== by 0x5804D8C4: mk_plain_bszB (m_mallocfree.c:277) ==2288== by 0x5804D8C4: get_bszB_as_is (m_mallocfree.c:302) ==2288== by 0x5804D8C4: is_inuse_block (m_mallocfree.c:332) ==2288== by 0x5804D8C4: vgPlain_arena_free (m_mallocfree.c:2128) ==2288== by 0x58004CAD: release_oldest_block (mc_malloc_wrappers.c:167) ==2288== by 0x58004CAD: create_MC_Chunk (mc_malloc_wrappers.c:210) ==2288== by 0x5800515F: vgMemCheck_new_block (mc_malloc_wrappers.c:386) ==2288== by 0x580052FE: vgMemCheck_malloc (mc_malloc_wrappers.c:405) ==2288== by 0x580A067D: do_client_request (scheduler.c:1979) ==2288== by 0x580A067D: vgPlain_scheduler (scheduler.c:1542) ==2288== by 0x580E587D: thread_wrapper (syswrap-linux.c:102) ==2288== by 0x580E587D: run_a_thread_NORETURN (syswrap-linux.c:155) sched status: running_tid=1 Thread 1: status = VgTs_Runnable (lwpid 2288) ==2288== at 0x4841848: malloc (vg_replace_malloc.c:431) ==2288== by 0x53CA8C7: UnknownInlinedFun (xcb_in.c:948) ==2288== by 0x53CA8C7: UnknownInlinedFun (xcb_out.c:55) ==2288== by 0x53CA8C7: UnknownInlinedFun (xcb_out.c:46) ==2288== by 0x53CA8C7: xcb_send_request_with_fds64 (xcb_out.c:338) ==2288== by 0x53CAA8D: xcb_send_request (xcb_out.c:359) ==2288== by 0xC69A93B: xcb_glx_query_server_string (glx.c:1653) ==2288== by 0x28EF36AF: __glXQueryServerString (glx_query.c:47) ==2288== by 0x28EF48CC: UnknownInlinedFun (glxext.c:713) ==2288== by 0x28EF48CC: glx_screen_init (glxext.c:753) ==2288== by 0x28F11392: dri3_create_screen.lto_priv.0 (dri3_glx.c:808) ==2288== by 0x28EF5108: UnknownInlinedFun (glxext.c:800) ==2288== by 0x28EF5108: __glXInitialize (glxext.c:935) ==2288== by 0x28EF5B65: glXGetFBConfigs (glxcmds.c:1460) ==2288== by 0x28EF5C47: glXChooseFBConfig (glxcmds.c:1400) ==2288== by 0x5A511C4: glXChooseFBConfig (libglx.c:1487) ==2288== by 0x2817BF48: DGL::puglX11GlConfigure(DGL::PuglViewImpl*) (x11_gl.c:72) ==2288== by 0x28177A8D: DGL::puglRealize(DGL::PuglViewImpl*) (x11.c:393) ==2288== by 0x28123931: DGL::Window::PrivateData::initPost() (WindowPrivateData.cpp:282) ==2288== by 0x280F1056: DISTRHO::PluginWindow::PluginWindow(DISTRHO::UI*, DISTRHO::PluginApplication&, unsigned long, unsigned int, unsigned int, double) (DistrhoUIPrivateData.hpp:201) ==2288== by 0x280F0801: DISTRHO::UI::PrivateData::createNextWindow(DISTRHO::UI*, unsigned int, unsigned int, bool) (DistrhoUI.cpp:207) ==2288== by 0x280F08D6: DISTRHO::UI::UI(unsigned int, unsigned int, bool) (DistrhoUI.cpp:221) ==2288== by 0x280F9F75: DISTRHO::MinatonUI::MinatonUI() (MinatonUI.cpp:25) ==2288== by 0x280FC625: DISTRHO::createUI() (MinatonUI.cpp:410) ==2288== by 0x280DD458: DISTRHO::UIExporter::UIExporter(void*, unsigned long, double, void (*)(void*, unsigned int, bool), void (*)(void*, unsigned int, float), void (*)(void*, char const*, char const*), void (*)(void*, unsigned char, unsigned char, unsigned char), void (*)(void*, unsigned int, unsigned int), bool (*)(void*, char const*), char const*, void*, double, unsigned int, unsigned int, char const*) (DistrhoUIInternal.hpp:89) ==2288== by 0x280DE102: DISTRHO::ClapUI::getSize(unsigned int*, unsigned int*) const (DistrhoPluginCLAP.cpp:290) ==2288== by 0x280D9133: DISTRHO::clap_gui_get_size(clap_plugin const*, unsigned int*, unsigned int*) (DistrhoPluginCLAP.cpp:2130) ==2288== by 0xB7670F: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7B422C: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7BA012: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7972E5: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x7AAA9E: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x54405D0: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x765618: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x795DF8: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x77AC38: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x407970: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x78D3C3: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x54311B5: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x5424C66: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x78B0F1: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x54311B5: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x5424C66: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x542F6CA: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x54250BC: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x5449936: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x544C80C: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x544F292: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x5431521: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x40C65D: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x4D29CCF: (below main) (libc_start_call_main.h:58) client stack range: [0x1FFEFE5000 0x1FFF000FFF] client SP: 0x1FFEFF1A40 valgrind stack range: [0x1002CCF000 0x1002DCEFFF] top usage: 19432 of 1048576 Thread 2: status = VgTs_WaitSys syscall 230 (lwpid 2505) ==2288== at 0x4DD7835: clock_nanosleep@@GLIBC_2.17 (clock_nanosleep.c:48) ==2288== by 0x4DE9EF6: nanosleep (nanosleep.c:25) ==2288== by 0x4E12978: usleep (usleep.c:31) ==2288== by 0x10E40894: ??? (in /usr/lib/REAPER/Plugins/reaper_video.so) ==2288== by 0x540BE2A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) client stack range: [0x2057A000 0x20D78FFF] client SP: 0x20D78DD0 valgrind stack range: [0x1012E76000 0x1012F75FFF] top usage: 3416 of 1048576 Thread 3: status = VgTs_WaitSys syscall 7 (lwpid 2556) ==2288== at 0x4E0559F: poll (poll.c:29) ==2288== by 0x7A888C6: UnknownInlinedFun (poll2.h:39) ==2288== by 0x7A888C6: poll_func (thread-mainloop.c:70) ==2288== by 0x7A7246B: pa_mainloop_poll (mainloop.c:863) ==2288== by 0x7A7C42B: pa_mainloop_iterate (mainloop.c:945) ==2288== by 0x7A7C4E0: pa_mainloop_run (mainloop.c:963) ==2288== by 0x7A8CC01: thread (thread-mainloop.c:101) ==2288== by 0x7B05C66: internal_thread_func (thread-posix.c:81) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) client stack range: [0x2DA14000 0x2E212FFF] client SP: 0x2E212C30 valgrind stack range: [0x1015265000 0x1015364FFF] top usage: 5272 of 1048576 Thread 4: status = VgTs_WaitSys syscall 0 (lwpid 2557) ==2288== at 0x4E05B9C: __libc_read (read.c:26) ==2288== by 0x4E05B9C: read (read.c:24) ==2288== by 0x7ACE4B5: UnknownInlinedFun (unistd.h:38) ==2288== by 0x7ACE4B5: pa_read (core-util.c:434) ==2288== by 0x7A7C0B6: UnknownInlinedFun (mainloop.c:802) ==2288== by 0x7A7C0B6: pa_mainloop_prepare (mainloop.c:810) ==2288== by 0x7A7C41C: pa_mainloop_iterate (mainloop.c:942) ==2288== by 0x7A7C4E0: pa_mainloop_run (mainloop.c:963) ==2288== by 0x7A8CC01: thread (thread-mainloop.c:101) ==2288== by 0x7B05C66: internal_thread_func (thread-posix.c:81) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) client stack range: [0x32215000 0x32A13FFF] client SP: 0x32A13C20 valgrind stack range: [0x101556D000 0x101566CFFF] top usage: 5272 of 1048576 Thread 5: status = VgTs_WaitSys syscall 202 (lwpid 2558) ==2288== at 0x4D8B555: __futex_lock_pi64 (futex-internal.c:180) ==2288== by 0x4D90D5B: __pthread_mutex_cond_lock_full (pthread_mutex_lock.c:441) ==2288== by 0x4D8DC23: __pthread_cond_wait_common (pthread_cond_wait.c:607) ==2288== by 0x4D8DC23: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.c:618) ==2288== by 0x7A89AAC: pa_threaded_mainloop_wait (thread-mainloop.c:216) ==2288== by 0x7A50800: pa_simple_write (simple.c:288) ==2288== by 0x41D1C2: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x41ADB0: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x41F37D: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x540BE2A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) client stack range: [0x32A16000 0x33214FFF] client SP: 0x33214CC8 valgrind stack range: [0x1015781000 0x1015880FFF] top usage: 4824 of 1048576 Thread 6: status = VgTs_WaitSys syscall 202 (lwpid 2559) ==2288== at 0x4D8B4AE: __futex_abstimed_wait_common64 (futex-internal.c:57) ==2288== by 0x4D8B4AE: __futex_abstimed_wait_common (futex-internal.c:87) ==2288== by 0x4D8E054: __pthread_cond_wait_common (pthread_cond_wait.c:503) ==2288== by 0x4D8E054: pthread_cond_timedwait@@GLIBC_2.3.2 (pthread_cond_wait.c:643) ==2288== by 0x540B7BC: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x6F5873: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x540BE2A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) client stack range: [0x33217000 0x33A15FFF] client SP: 0x33A15C20 valgrind stack range: [0x1015A85000 0x1015B84FFF] top usage: 3536 of 1048576 Thread 7: status = VgTs_WaitSys syscall 202 (lwpid 2560) ==2288== at 0x4D8B4AE: __futex_abstimed_wait_common64 (futex-internal.c:57) ==2288== by 0x4D8B4AE: __futex_abstimed_wait_common (futex-internal.c:87) ==2288== by 0x4D8E054: __pthread_cond_wait_common (pthread_cond_wait.c:503) ==2288== by 0x4D8E054: pthread_cond_timedwait@@GLIBC_2.3.2 (pthread_cond_wait.c:643) ==2288== by 0x540B7BC: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x6F5873: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x540BE2A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) client stack range: [0x33A18000 0x34216FFF] client SP: 0x34216C20 valgrind stack range: [0x1015D89000 0x1015E88FFF] top usage: 3496 of 1048576 Thread 8: status = VgTs_WaitSys syscall 202 (lwpid 2561) ==2288== at 0x4D8B4AE: __futex_abstimed_wait_common64 (futex-internal.c:57) ==2288== by 0x4D8B4AE: __futex_abstimed_wait_common (futex-internal.c:87) ==2288== by 0x4D8E054: __pthread_cond_wait_common (pthread_cond_wait.c:503) ==2288== by 0x4D8E054: pthread_cond_timedwait@@GLIBC_2.3.2 (pthread_cond_wait.c:643) ==2288== by 0x540B7BC: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x6F575C: ??? (in /usr/lib/REAPER/reaper) ==2288== by 0x540BE2A: ??? (in /usr/lib/REAPER/libSwell.so) ==2288== by 0x4D8E9EA: start_thread (pthread_create.c:444) ==2288== by 0x4E12C83: clone (clone.S:100) client stack range: [0x34219000 0x34A17FFF] client SP: 0x34A17C20 valgrind stack range: [0x101608D000 0x101618CFFF] top usage: 3264 of 1048576 Note: see also the FAQ in the source distribution. It contains workarounds to several common problems. In particular, if Valgrind aborted or crashed after identifying problems in your program, there's a good chance that fixing those problems will prevent Valgrind aborting or crashing, especially if it happened in m_mallocfree.c. If that doesn't help, please report this bug to: www.valgrind.org In the bug report, send all the above text, the valgrind version, and what OS and version you are using. Thanks. ```

But now I have a better solution.

The problematic buffers are resampler input buffers. They should have the same size as host buffer, so I used to reallocate it on buffer size changes.

As host buffers has a bunch of common sizes (16 ~ 2048), I really don't need to reallocate my buffers all the time.

Now I prefer fixed size of my own buffer arrays, with enough size (16384). I believe this can work on almost all common hosts and DAWs. It can also deal with the situation of unexpected host buffer (e.g. getBufferSize() reports 1024, but host calls run() with frames of 2048).

falkTX commented 1 year ago

typically you only reallocate buffers to the size that the host tells you it is going to use, the buffer size hint, but hosts can and will process with less samples sometimes (and more rarely also with more)

a very high buffer size wastes memory, but anyway that is your call and not an issue on DPF side. closing the ticket

AnClark commented 1 year ago

OK, I will choose a smaller buffer size.

Many thanks!