Skip to content

libobs: find_libobs_data_file crashes on macOS when the libobs bundle is not found #2538

Closed

Description

@vpacher

Problem

On macOS, find_libobs_data_file() (libobs/obs-cocoa.m.h) crashes when libobs is loaded from a libobs.framework that has no bundle identifier (no Info.plist). [NSBundle bundleWithIdentifier:@"com.obsproject.libobs"] then returns nil, the path string is nil, and strlen(libobsDataPath.UTF8String) is strlen(NULL).

Every obs_find_data_file() call goes through it, so the first lookup crashes (for example obs_startup() loading default.effect in a host that has no graphics module yet, or a plugin's lookup).

It happens in CI: the macOS Rust Tier 2 stage Cargo [obs-c-reference] unchanged ctest suite runs the cmocka tests against build_rust/cargo-native-core/obs-c-reference/libobs.framework, which obs-build makes without an Info.plist. test_obs_core_info_characterization (test_find_data_file) crashes there with SIGSEGV, in both runs of #2514. Upstream OBS has the same code.

Reproduction on macOS: copy Versions/A/libobs of a built libobs.framework into a new libobs.framework with no Info.plist, and run test_obs_core_info_characterization with DYLD_FRAMEWORK_PATH set to its parent folder.

Fix

Return NULL when the bundle (or its path) is not found. obs_find_data_file() then searches the data paths from obs_add_data_path(), as on Linux and Windows. With the bundle present, nothing changes.

The other macOS difference (with the bundle, every lookup returns a Resources path, also for a missing file) is not part of this issue.

I am taking this one.

Activity

  1. vpacher commented on Oct 26, 2026

    @vpacher
    MemberAuthor

    Claiming: #2538

    One PR: the NULL return in find_libobs_data_file. RED is master's macOS Rust Tier 2 cargo stage (test_find_data_file, SIGSEGV), reproduced locally with a libobs.framework without Info.plist.

  2. added
    ready
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions