amy_default_config: zero the config, and NULL the cv output hook - #1188
Merged
Merged
Conversation
amy_external_cv_output_hook (added with note outputs) was never set in amy_default_config(), so on any host that did not install one it held whatever was on the caller's stack. The first note to a synth with note_output=CV_GATE then called through it: a jump to a random address (SIGBUS on macOS, from patches_event_has_voices -> note_output_handle_event -> cv_output). Set it to NULL like its neighbours, and memset the struct first so a field added later and missed in the list is 0 rather than garbage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dpwe
reviewed
Sep 25, 2026
| // first time AMY calls it (amy_external_cv_output_hook was exactly | ||
| // that: never initialised here, so a note output crashed any host | ||
| // that did not set it). | ||
| memset(&c, 0, sizeof(c)); |
Collaborator
There was a problem hiding this comment.
I kinda hate this kind of belt-and-braces because it leads to inconsistent redundancy. But whatever
Collaborator
Author
⛓️ tulipcc integration PR openedThis merge was pinned into tulipcc for full-system CI: shorepine/tulipcc#1376 Test it there and merge that PR to move tulipcc onto this AMY. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
amy_external_cv_output_hook(added with note outputs, #1172) is never initialised inamy_default_config(), so on a host that doesn't install one it holds stack garbage. The first note sent to a synth withnote_output=CV_GATEthen calls through it incv_output()— a jump to a random address (seen as SIGBUS on macOS, stackc_amy_send_wire → amy_play_message → amy_event_to_deltas_queue → patches_event_has_voices → note_output_handle_event).This sets it to NULL like the other hooks, and
memsets the struct first so any field added later and missed in the list defaults to 0/NULL instead of garbage.Verified on a macOS miniaudio host: a synth configured with
note_output='1,0,2'and sent notes no longer crashes.🤖 Generated with Claude Code