libobs: append message/get_messages to obs_source_info (fix ABI skew crash)#735
Open
summeroff wants to merge 1 commit into
Open
libobs: append message/get_messages to obs_source_info (fix ABI skew crash)#735summeroff wants to merge 1 commit into
summeroff wants to merge 1 commit into
Conversation
They were inserted mid-struct (after activate), shifting the offsets of get_defaults2 and every later field and breaking ABI for modules built against an older obs-source.h. Moving them to the end preserves existing field offsets; older structs simply zero-fill the new pointers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adjusts the obs_source_info public API struct layout in libobs to eliminate plugin ABI skew that can cause crashes when older-built modules are loaded, by ensuring newly added callbacks are appended rather than inserted mid-struct.
Changes:
- Moved
messageandget_messagescallbacks from mid-struct obs_source_infoto the end of the struct to preserve offsets of existing fields. - Added an in-header note documenting the “append-only” requirement to avoid future ABI breaks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sandboxcoder
approved these changes
Jun 11, 2026
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.
Fixes a 1.21.2 Sentry crash:
EXCEPTION_ACCESS_VIOLATION_EXECatobs-source.c:385(info->get_defaults2).message/get_messageswere inserted mid-struct (afteractivate, #647), shifting the offsets ofget_defaults2and every later field. A module built against an olderobs-source.hthen readsget_defaults2at the wrong offset and calls a garbage pointer duringobs_source_create. Appending them to the end ofobs_source_inforestores the original offsets; older structs simply zero-fill the new fields.Field reorder only — no behavior change.
🤖 Generated with Claude Code