Skip to content

libobs: append message/get_messages to obs_source_info (fix ABI skew crash)#735

Open
summeroff wants to merge 1 commit into
streamlabsfrom
fix/source-info-abi-append
Open

libobs: append message/get_messages to obs_source_info (fix ABI skew crash)#735
summeroff wants to merge 1 commit into
streamlabsfrom
fix/source-info-abi-append

Conversation

@summeroff

Copy link
Copy Markdown

Fixes a 1.21.2 Sentry crash: EXCEPTION_ACCESS_VIOLATION_EXEC at obs-source.c:385 (info->get_defaults2).

message/get_messages were inserted mid-struct (after activate, #647), shifting the offsets of get_defaults2 and every later field. A module built against an older obs-source.h then reads get_defaults2 at the wrong offset and calls a garbage pointer during obs_source_create. Appending them to the end of obs_source_info restores the original offsets; older structs simply zero-fill the new fields.

Field reorder only — no behavior change.

🤖 Generated with Claude Code

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 message and get_messages callbacks from mid-struct obs_source_info to 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.

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.

3 participants