Skip to content

wrappers: always hand the effect zero-filled channels (never null)#142

Open
jcelerier wants to merge 1 commit into
mainfrom
fix/safe-channel-buffers
Open

wrappers: always hand the effect zero-filled channels (never null)#142
jcelerier wants to merge 1 commit into
mainfrom
fix/safe-channel-buffers

Conversation

@jcelerier

Copy link
Copy Markdown
Member

Extracted from the avendish-ui branch so it can land independently (it is unrelated to the UI work it was riding on).

The process adapters (process/ and process_bus/, per-channel and poly) already had storage to point missing channels at silent scratch buffers, but it was gated behind a commented-out AVND_ENABLE_SAFE_BUFFER_STORAGE. By default, a host supplying fewer channels than the object declares left bus.channel = nullptr — any effect that dereferences its channel then crashes. An effect must always receive valid, zero-filled channel buffers.

This enables the safe buffer storage by default; opt out with -DAVND_ENABLE_SAFE_BUFFER_STORAGE=0. process_bus/base.hpp includes process/base.hpp, so one definition covers every backend.

Verified: full build (examples across enabled backends) + the 100-test suite passing with clang-cl on Windows.

🤖 Generated with Claude Code

https://claude.ai/code/session_014Zm2k4dsLp2jMa47zyLcSZ

The process adapters (process/ and process_bus/, per-channel and poly) already
had storage to point missing channels at silent scratch buffers, but it was
gated behind a commented-out AVND_ENABLE_SAFE_BUFFER_STORAGE, so by default a
host supplying fewer channels than the object declares left bus.channel = nullptr
-- any effect that dereferences its channel then crashes. That null path is a
core-invariant violation: an effect must always receive valid, zero-filled
channel buffers.

Enable the safe buffer storage by default (opt out with
-DAVND_ENABLE_SAFE_BUFFER_STORAGE=0). process_bus/base.hpp includes
process/base.hpp, so this one definition covers every backend.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011s7huWR2wFsLFiMJPjx1z2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant