BASSMIDI segfaults when freeing SoundFonts from multiple streams

Started by bree,

bree

Hi Ian,

We've encountered an issue where BASSMIDI will occasionally segfault when we rapidly free a BASS_MIDI_FONT(EX) array and then reload it with new SoundFonts, particularly when doing so across multiple streams simultaneously (typically 32 or more, where the problem becomes much more frequent).

This seems somewhat related to the previous post, in which we were creating a large number of streams to process MIDI data in chunks — splitting the "MIDI keyboard" range (1–128) from each channel (1–16) into chunks. For example, asking for a divisor of 4 chunks would mean allocating 16x4 streams.

We've found that the more streams we allocate, the higher the likelihood of a segfault when live-swapping SoundFonts. With only a few streams, the problem doesn't seem to occur, but once we exceed 8 streams, the crashes start happening more frequently.

Currently we're working on a new branch (https://github.com/KeppySoftware/OmniMIDIv2/tree/buffered_multithreading), but this happens on the old branch too, as soon as we start dealing with more than 8 streams at once.

Ian @ un4seen

For more info, please provide a dump file from that crash. You will hopefully find a dump file in the "%LOCALAPPDATA%\CrashDumps" folder, which you can ZIP and upload here:

    ftp://ftp.un4seen.com/incoming/

bree

Quote from: Ian @ un4seenFor more info, please provide a dump file from that crash. You will hopefully find a dump file in the "%LOCALAPPDATA%\CrashDumps" folder, which you can ZIP and upload here:

    ftp://ftp.un4seen.com/incoming/
I sent it, but I forgot to zip it oops! I don't know if the FTP server automatically deletes unzipped files, so I reuploaded it inside a zip archive.
The file is ziggy.exe.14064.dmp.zip.

Ian @ un4seen

The dump file reveals where the crash happened, but unfortunately not exactly why. I have an idea why it might have been, so here's an update for you to try:

    www.un4seen.com/stuff/bassmidi.zip

If it still crashes, please upload a new dump file. It probably won't affect this problem, but please also use the latest BASS build when producing the crash:

    www.un4seen.com/stuff/bass.zip

bree

Quote from: Ian @ un4seenThe dump file reveals where the crash happened, but unfortunately not exactly why. I have an idea why it might have been, so here's an update for you to try:

    www.un4seen.com/stuff/bassmidi.zip

If it still crashes, please upload a new dump file. It probably won't affect this problem, but please also use the latest BASS build when producing the crash:

    www.un4seen.com/stuff/bass.zip
Would it be possible to compile Linux libraries as well?