clearly-broken-software / ninjas2

Rewrite of Ninjas sample slicer
GNU General Public License v3.0
180 stars 13 forks source link

VST plugin crashes on opening of sample #130

Open SuperSonicHub1 opened 2 years ago

SuperSonicHub1 commented 2 years ago

The file is a simple Amen Break WAV (pcm_s16be 2ch 44100Hz, 6 seconds) which plays just fine in mpv.

I should mention that I have installed both ninjas2 and Ardour through Flatpak, if that is a possible source of trouble.

Log from Ardour 6.9:

WARNING: Your system has a limit for maximum amount of locked memory!
         This might cause Ardour to run out of memory before your system runs
         out of memory. You can view the memory limit with 'ulimit -l', and it
         is normally controlled by /etc/security/limits.conf

WARNING: Could not check your glib-2.0 for mutex locking atomic operations.

Ardour6.9.0 (built using 6.9 and GCC version 11.3.0)
Ardour: [INFO]: Your system is configured to limit Ardour to 1048576 open files
Ardour: [INFO]: Loading system configuration file /app/etc/ardour6/system_config
Ardour: [INFO]: Loading user configuration file /home/kwilliams/.var/app/org.ardour.Ardour/config/ardour6/config
Ardour: [INFO]: CPU vendor: AuthenticAMD
Ardour: [INFO]: AVX-capable processor
Ardour: [INFO]: AVX with FMA capable processor
Ardour: [INFO]: CPU brand: AMD Ryzen 5 5600X 6-Core Processor             
Ardour: [INFO]: Using AVX and FMA optimized routines
Ardour: [INFO]: Loading plugin meta data file /app/share/ardour6/plugin_metadata/plugin_tags
Ardour: [INFO]: Loading plugin statistics file /home/kwilliams/.var/app/org.ardour.Ardour/config/ardour6/plugin_metadata/plugin_stats
Cannot xinstall SIGPIPE error handler
Ardour: [INFO]: Loading default ui configuration file /app/etc/ardour6/default_ui_config
Ardour: [INFO]: Loading user ui configuration file /home/kwilliams/.var/app/org.ardour.Ardour/config/ardour6/ui_config
Ardour: [INFO]: Loading 452 MIDI patches from /app/share/ardour6/patchfiles
Ardour: [INFO]: Loading color file /app/share/ardour6/themes/dark-ardour.colors
Ardour: [INFO]: Loading ui configuration file /app/etc/ardour6/clearlooks.rc
Ardour: [INFO]: Loading bindings from /app/etc/ardour6/ardour.keys
Loading ui configuration file /app/etc/ardour6/clearlooks.rc
ALSA: Cannot open device 'hw:Generic,0': Device or resource busy
ALSA: Cannot open device 'hw:Generic,0': Device or resource busy
ALSA: Cannot open device 'hw:Generic,0': Device or resource busy
ALSA: Cannot open device 'hw:Generic,0': Device or resource busy
ALSA: Cannot open device 'hw:Generic,0': Device or resource busy
Found nothing along /home/kwilliams/.var/app/org.ardour.Ardour/config/ardour6/templates:/app/share/ardour6/templates
ALSA: Cannot open device 'hw:Generic,0': Device or resource busy
ALSA: Cannot open device 'hw:Generic,0': Device or resource busy
ALSA: Cannot open device 'hw:Generic,0': Device or resource busy
ALSA: Cannot open device 'hw:Generic,0': Device or resource busy
ALSA: Cannot open device 'hw:Generic,0': Device or resource busy
Scanning folders for bundled LV2s: /app/lib/ardour6/LV2
Set cursor set to default
Reading player:Ninjas 2 took 1 microseconds, final size = 0
Plugin UI running in 'Ardour'
/usr/include/c++/11.2.0/bits/stl_vector.h:1045: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = float; _Alloc = std::allocator<float>; std::vector<_Tp, _Alloc>::reference = float&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__n < this->size()' failed.
watched PID no longer exists - releasing device.
rghvdberg commented 2 years ago

I didn't know there was a flatpak version of ninjas2 I wouldn't know how to debug this. Does ninjas2 also crash with your wav file if you use the binary provided by the github release?

SuperSonicHub1 commented 2 years ago

I compiled the standalone app on my machine and tested it with the WAV file I used. Because of how Flatpak works, any VST plugins used by the Flatpak installation of Ardour must also be installed with Flatpak. It's not super convenient right now for me to set up another VST at the moment. I personally get the feeling that this is the fault of the Flathub package maintainers, which you aren't part of, so it seems a tad silly to burden you with this. Honestly, I've spent too much energy on trying to use Ardour for free; I'm just going to pay for it and use it normally.

rghvdberg commented 2 years ago

I'd like to keep this open.

danielappelt commented 1 year ago

@rghvdberg I get a similar error when using the standalone version of ninjas2 in Arch Linux when trying to open a wav or mp3 file:

/usr/include/c++/12.2.1/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = float; _Alloc = std::allocator<float>; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.

My system is up-to-date. Ninjas2 is at version 0.2.0 in the Arch repositories. LV2 and VST versions of the plugin crash at well.

rghvdberg commented 1 year ago

Pleased try the binary from the github release page and see if that also crashes.

Op zo 23 apr. 2023 18:13 schreef Daniel Appelt @.***>:

@rghvdberg https://github.com/rghvdberg I get a similar error when using the standalone version of ninjas2 in Arch Linux when trying to open a wav or mp3 file:

/usr/include/c++/12.2.1/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator [with _Tp = float; _Alloc = std::allocator; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.

My system is up-to-date. Ninjas2 is at version 0.2.0 in the Arch repositories https://archlinux.org/packages/community/x86_64/ninjas2-standalone/. LV2 and VST versions of the plugin crash at well.

— Reply to this email directly, view it on GitHub https://github.com/clearly-broken-software/ninjas2/issues/130#issuecomment-1519102035, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRW5B5TASCU3H7UGXLVUJ3XCVIKPANCNFSM5YSKNKOA . You are receiving this because you were mentioned.Message ID: @.***>

danielappelt commented 1 year ago

@rghvdberg the LV2 from the Github release works!

Maybe the problem has to do with this Arch build patch that pulls in a system-installed aubio and not the one from this repo? I have opened a corresponding ticket for Arch Linux as the error might be in the build.

danielappelt commented 1 year ago

@rghvdberg this line seems to be the culprit. When compiling the Arch package on my machine, I get this warning:

Ninjas2Plugin.cpp:937:47: Warnung: Vergleich von Ganzzahlausdrücken, von denen nur einer ein Vorzeichen hat: »int« und »std::vector<float>::size_type« {aka »long unsigned int«} [-Wsign-compare] 937 | if ( ( sliceStart + pos ) > ( sampleVector.size()-sampleChannels ) ) { | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Putting sampleVector.size() into a local int variable and using this new variable in the comparison fixes the problem here. I could provide a PR if you like.

derkrasseleo commented 1 year ago

Will this fix be applied? I'm not sure if this is the exact same error, but this is what I get after trying to load a sample:

/usr/include/c++/12.2.1/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = float; _Alloc = std::allocator<float>; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Abgebrochen (Speicherabzug geschrieben)
rghvdberg commented 1 year ago

The standalone should only be used for debugging. It's not meant for production AT ALL.

derkrasseleo commented 1 year ago

I know, that's exactly why I used it :sweat_smile:

138 fixed my issue btw.