dan-german / blocks

user-friendly cross-platform modular synth
https://www.soonth.com
GNU General Public License v3.0
132 stars 14 forks source link

Linux Release builds segfault #39

Open dromer opened 1 month ago

dromer commented 1 month ago

Not just because of LV2, but the current Release downloads on the main website are just as broken.

The LV2 action that fails: https://github.com/dan-german/blocks/actions/runs/10280350079/job/28447495778

And what we see when enabling address sanitizer:

LeakSanitizer output: ``` ==27359==ERROR: LeakSanitizer: detected memory leaks Direct leak of 83892224 byte(s) in 384 object(s) allocated from: #0 0x7fba7f0b9628 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:98 #1 0x7fba7b8aa958 in vital::Reverb::setupBuffersForSampleRate(int) (/home/dreamer/Sources/_audio/blocks/build/blocks_artefacts/Release/LV2/blocks.lv2/libblocks.so+0x8aa958) Direct leak of 2622976 byte(s) in 96 object(s) allocated from: #0 0x7fba7f0b9628 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:98 #1 0x7fba7b8aabac in vital::Reverb::setupBuffersForSampleRate(int) (/home/dreamer/Sources/_audio/blocks/build/blocks_artefacts/Release/LV2/blocks.lv2/libblocks.so+0x8aabac) Direct leak of 704 byte(s) in 8 object(s) allocated from: #0 0x7fba7f0b94c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7fba7b966dae in vital::Delay::Delay(int) [clone .lto_priv.0] (/home/dreamer/Sources/_audio/blocks/build/blocks_artefacts/Release/LV2/blocks.lv2/libblocks.so+0x966dae) Direct leak of 704 byte(s) in 8 object(s) allocated from: #0 0x7fba7f0b94c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7fba7b928380 in vital::BlocksVoiceHandler::createReverbs() (/home/dreamer/Sources/_audio/blocks/build/blocks_artefacts/Release/LV2/blocks.lv2/libblocks.so+0x928380) Direct leak of 704 byte(s) in 8 object(s) allocated from: #0 0x7fba7f0b94c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7fba7b94cf30 in vital::DelayModule::setSampleRate(int) (/home/dreamer/Sources/_audio/blocks/build/blocks_artefacts/Release/LV2/blocks.lv2/libblocks.so+0x94cf30) #2 0x6280000000ff () Direct leak of 1 byte(s) in 1 object(s) allocated from: #0 0x7fba7f0b94c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7fba7b7328c1 in PluginProcessor::PluginProcessor() (/home/dreamer/Sources/_audio/blocks/build/blocks_artefacts/Release/LV2/blocks.lv2/libblocks.so+0x7328c1) Indirect leak of 67108864 byte(s) in 32 object(s) allocated from: #0 0x7fba7f0b9628 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:98 #1 0x7fba7b966f70 in vital::Delay::Delay(int) [clone .lto_priv.0] (/home/dreamer/Sources/_audio/blocks/build/blocks_artefacts/Release/LV2/blocks.lv2/libblocks.so+0x966f70) Indirect leak of 67108864 byte(s) in 32 object(s) allocated from: #0 0x7fba7f0b9628 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:98 #1 0x7fba7b94d0fd in vital::DelayModule::setSampleRate(int) (/home/dreamer/Sources/_audio/blocks/build/blocks_artefacts/Release/LV2/blocks.lv2/libblocks.so+0x94d0fd) #2 0x6280000000ff () Indirect leak of 33554432 byte(s) in 16 object(s) allocated from: #0 0x7fba7f0b9628 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:98 #1 0x7fba7b9284cd in vital::BlocksVoiceHandler::createReverbs() (/home/dreamer/Sources/_audio/blocks/build/blocks_artefacts/Release/LV2/blocks.lv2/libblocks.so+0x9284cd) SUMMARY: AddressSanitizer: 254289473 byte(s) leaked in 585 allocation(s). gmake[2]: *** [CMakeFiles/blocks_LV2.dir/build.make:214: blocks_artefacts/Release/LV2/blocks.lv2/libblocks.so] Error 1 gmake[2]: *** Deleting file 'blocks_artefacts/Release/LV2/blocks.lv2/libblocks.so' gmake[1]: *** [CMakeFiles/Makefile2:244: CMakeFiles/blocks_LV2.dir/all] Error 2 gmake: *** [Makefile:136: all] Error 2 ```

When doing a Debug build everything is fine.

dan-german commented 1 month ago

just linux or also windows? mac M1 works for me. are you sure it's not related to todays changes? people haven't been complaining about the executables not working.

let me revert everything back and we'll see

dromer commented 1 month ago

I downloaded from https://www.soonth.com/ and I have no idea what build that is. Since you disabled the LV2 builds on Linux it shouldn't be related to anything like that.

I think it's only on Linux since we see that in the CI the final linked binary segfaults. From what I can tell JUCE will always try to test the resulting LV2 bundle. On Windows and macOS these builds went fine. When I build locally without the Release flag it also works fine.

I think it's because the Release flag enables these LTO builds. Could be there are some conficting symbols or something else that gets triggered by this, but only on Linux.

dromer commented 1 month ago

people haven't been complaining about the executables not working

I think you haven't had any Linux users yet ;)

dromer commented 1 month ago

@dan-german so the download on your site is always the latest build from CI?

The Linux build there definitely segfaults.

dan-german commented 1 month ago

@dan-german so the download on your site is always the latest build from CI?

yep!

The Linux build there definitely segfaults.

maybe it's a distro thing? i dont have any machine other than my macbook so i wont be able to fix that anytime soon unfortunately :(

dromer commented 1 month ago

maybe it's a distro thing?

No, it's an LTO and source-code thing.