diff --git a/CHANGELOG.md b/CHANGELOG.md index a493183a..9b490611 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,14 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed +- Fixed a regression from yabridge 3.4.0 where plugins with zero audio channels + would result in a crash. +- Fixed a regression from yabridge 3.4.0 where JUCE-based VST3 plugins might + cause **Ardour** or **Mixbus** to freeze in very specific circumstances. - Worked around a **REAPER** bug that would cause REAPER to not process any keyboard input when the FX window is active but the mouse is outside of the window. We now use the same validation used in `xprop` and `xwininfo` to find the host's window instead of always taking the topmost window. -- Fixed a regression from yabridge 3.4.0 where JUCE-based VST3 plugins might - cause **Ardour** or **Mixbus** to freeze. ## [3.4.0] - 2021-07-15 diff --git a/src/common/audio-shm.cpp b/src/common/audio-shm.cpp index 99dafd43..bc4acd40 100644 --- a/src/common/audio-shm.cpp +++ b/src/common/audio-shm.cpp @@ -21,10 +21,14 @@ AudioShmBuffer::AudioShmBuffer(const Config& config) shm(boost::interprocess::open_or_create, config.name.c_str(), boost::interprocess::read_write) { - shm.truncate(config.size); - buffer = - boost::interprocess::mapped_region(shm, boost::interprocess::read_write, - 0, config.size, nullptr, MAP_LOCKED); + // Apparently you get a `Resource temporarily unavailable` when calling + // `ftruncate()` with a size of 0 on shared memory + if (config.size > 0) { + shm.truncate(config.size); + buffer = boost::interprocess::mapped_region( + shm, boost::interprocess::read_write, 0, config.size, nullptr, + MAP_LOCKED); + } } AudioShmBuffer::~AudioShmBuffer() noexcept { @@ -44,10 +48,12 @@ void AudioShmBuffer::resize(const Config& new_config) { } config = new_config; - shm.truncate(config.size); - buffer = - boost::interprocess::mapped_region(shm, boost::interprocess::read_write, - 0, config.size, nullptr, MAP_LOCKED); + if (config.size > 0) { + shm.truncate(config.size); + buffer = boost::interprocess::mapped_region( + shm, boost::interprocess::read_write, 0, config.size, nullptr, + MAP_LOCKED); + } } AudioShmBuffer::AudioShmBuffer(AudioShmBuffer&& o) noexcept