swesterfeld / liquidsfz

SFZ Sampler
Mozilla Public License 2.0
87 stars 12 forks source link

0.3.0: lv2lint crashes on lv2 plugin #34

Closed dvzrv closed 2 years ago

dvzrv commented 2 years ago

When trying to build 0.3.0 as a package for Arch Linux I was not able to succesfully run lv2lint on the resulting plugin.

I build as follows:

  autoreconf -fiv
  ./configure \
    --prefix=/usr \
    --enable-shared \
    --disable-static \
    --disable-static-cxx
  make

and then run lv2lint on the plugin in the build directory:

LD_LIBRARY_PATH="$pkgname-$pkgver/lib/.libs/:$LD_LIBRARY_PATH" lv2lint -Mpack -I $pkgname-$pkgver/lv2 "http://spectmorph.org/plugins/liquidsfz"
lv2lint 0.16.2
Copyright (c) 2016-2021 Hanspeter Portner (dev@open-music-kontrollers.ch)
Released under Artistic License 2.0 by Open Music Kontrollers
/usr/include/c++/12.1.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = char; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
/startdir/PKGBUILD: line 49:  5539 Aborted                 (core dumped) LD_LIBRARY_PATH="$pkgname-$pkgver/lib/.libs/:$LD_LIBRARY_PATH" lv2lint -Mpack -I $pkgname-$pkgver/lv2 "http://spectmorph.org/plugins/liquidsfz"
dvzrv commented 2 years ago

FWIW, the release can not be built without https://github.com/swesterfeld/liquidsfz/pull/35 and https://github.com/swesterfeld/liquidsfz/commit/82ce2bb1c18c4addfbda94643dcf7f7b836a13d7 using gcc >= 12. Building pull requests and this project in general against several (especially newer) gcc versions and testing the resulting binaries (e.g. with lv2lint in the case of the lv2 plugin) in CI would be much appreciated, as it leads to less friction upon upgrades for downstreams.

swesterfeld commented 2 years ago

I was able to reproduce the crash if I build with -D_GLIBCXX_ASSERTIONS enabled. Can you please re-test if it still crashes for you if you build from github master? The commit https://github.com/swesterfeld/liquidsfz/commit/01f0eb84f8efb3728f8627c9c37176902bba8e0a should fix it (at least with it I cannot reproduce the crash).

dvzrv commented 2 years ago

Thanks, that seems to fix it!

swesterfeld commented 2 years ago

Ok great, I'll close the issue. I'll need to make a new liquidsfz release as soon as possible, since this bug is probably not only affecting Arch Linux. I also found another bug in 0.3.0 which can cause crashes, so basically once released everyone should be using 0.3.1.

As for CI - good idea. I have scripts that build on gcc:latest and archlinux now, both with gcc and clang and run lv2lint. Also there is a new program called testsynth, which contains a few tests that test the liquidsfz Synth class directly, so this can catch problems in the synthesis code that lv2lint can't see.