Go to file
byrongamatos 8354194722 fix(audio): LoadVST's macOS branch deadlocked on the chain mutex
The same finding as the clearChain/remove/moveProcessor fix, in a path I
missed on the first pass. CodeRabbit pointed at this line for the wrong reason
(it claimed the mutation was unguarded — it is guarded); the real defect is
WHERE the guard is taken.

LoadVST's macOS branch took a blocking lock_guard on chainMutationMutex on the
Node/main thread. On macOS that thread is also JUCE's message thread, and it
has no pump — its queue is drained by a libuv timer that only runs when the
thread is idle.

Meanwhile a LoadPresetWorker holding that mutex on a libuv thread calls JUCE's
*synchronous* createPluginInstance, which — when called off the message thread,
which is exactly where a worker calls it — posts an AsyncCreateMessage to the
message thread and blocks until it runs (juce_AudioPluginFormat.cpp,
createInstanceFromDescription). So: main thread blocks on the mutex → the
message queue stops draining → the worker's load never completes → the mutex is
never released → the app hangs permanently. Adding a VST while a preset load is
in flight was enough to trigger it.

The in-code comment asserted this was deadlock-safe because "loadVstSandboxAware's
JUCE_MAC branch is a synchronous load on the worker itself" — but JUCE's sync
load is not synchronous off the message thread, which is what makes the cycle.

The plugin INSTANTIATION has to stay on the main thread (JUCE requires it for
VST/AU on macOS), so only the mutation moves: it now goes through
queueChainSlotMutation(), a slot-id-returning sibling of queueChainMutation().
While the worker waits for the mutex the main thread stays free to drain the
queue, so the in-flight load completes and releases it.

The branch is portable C++, so it was compile-checked on Linux by forcing the
#if; the macOS addon lane is the real gate.
2026-07-14 15:13:09 +02:00
.claude/skills Clean release snapshot 2026-06-16 18:48:12 +02:00
.devcontainer ci: repoint desktop build off the deleted slopsmith org 2026-06-17 00:47:43 +02:00
.github/workflows fix(nightly): dedupe publish assets across overlapping globs 2026-07-12 23:09:11 +02:00
.packages Clean release snapshot 2026-06-16 18:48:12 +02:00
.specify Clean release snapshot 2026-06-16 18:48:12 +02:00
cmake Clean release snapshot 2026-06-16 18:48:12 +02:00
docs docs: commit the audio-engine TLC findings + plan this branch implements 2026-07-14 03:24:46 +02:00
JUCE@9971c75b2c Clean release snapshot 2026-06-16 18:48:12 +02:00
resources fix(ci): rename entitlements file — vpk requires .entitlements extension 2026-07-10 15:04:31 +02:00
scripts feat(build): bundle bongocat plugin 2026-07-13 22:01:52 +02:00
src fix(audio): LoadVST's macOS branch deadlocked on the chain mutex 2026-07-14 15:13:09 +02:00
tests fix(renderer): roll back the mute-suppression latch when the IPC fails 2026-07-14 14:52:34 +02:00
.build-config.json fix(build): make the local + CI Linux build work off main (#26) 2026-06-20 14:32:01 +02:00
.gitignore Clean release snapshot 2026-06-16 18:48:12 +02:00
.gitmodules Clean release snapshot 2026-06-16 18:48:12 +02:00
CMakeLists.txt Clean release snapshot 2026-06-16 18:48:12 +02:00
CONTRIBUTORS.md Clean release snapshot 2026-06-16 18:48:12 +02:00
LICENSE Clean release snapshot 2026-06-16 18:48:12 +02:00
package.json feat(panes): pane pop-out windows + the system tray 2026-07-12 17:22:44 -04:00
THIRD_PARTY_LICENSES.md Clean release snapshot 2026-06-16 18:48:12 +02:00
tsconfig.json Clean release snapshot 2026-06-16 18:48:12 +02:00
WINDOWS_BUILD_REQUIREMENTS.md Repoint dead slopsmith URLs -> got-feedback 2026-06-17 11:02:09 +02:00