Repository navigation
libobs: Return NULL from find_libobs_data_file without the libobs bundle (#2538) - #2540
Merged
Merged
Conversation
…dle (#2538) On macOS, find_libobs_data_file() built the path from [NSBundle bundleWithIdentifier:@"com.obsproject.libobs"]. When libobs is loaded from a libobs.framework with no bundle identifier (no Info.plist), the bundle is nil, the path string is nil and strlen(libobsDataPath.UTF8String) is strlen(NULL): the first obs_find_data_file() call crashed. The macOS Rust Tier 2 stage "Cargo [obs-c-reference] unchanged ctest suite" runs the cmocka tests against such a framework (obs-build makes it without an Info.plist), so test_obs_core_info_characterization (test_find_data_file) crashed there with SIGSEGV. Now the function returns NULL when the bundle or its path is not found, and obs_find_data_file() searches the data paths, as on Linux and Windows. With the bundle present, nothing changes. RED: master's macOS Rust Tier 2 cargo stage (two runs of #2514), and locally test_obs_core_info_characterization against a libobs.framework without Info.plist: SIGSEGV in test_find_data_file. GREEN: the same framework 8/8; the CMake libobs-c-reference and hybrid frameworks 7/8 plus the macOS skip, as before (5 runs each). Fixes #2538 Co-Authored-By: Claude Opus 5.5 <[email protected]>
zackees
reviewed
Oct 26, 2026
zackees
left a comment
Member
There was a problem hiding this comment.
Reviewed: both nil checks (bundle, then the UTF-8 string) return NULL before strlen, and obs_find_data_file then falls through to the data paths, as on Linux and Windows. With the bundle present nothing changes. The RED is the crash on master's macOS lane (run 40410629662), and the ledger line is present. Queuing; I closed my skip-based #2539 in favour of this.
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 #2538
On macOS,
find_libobs_data_file()(libobs/obs-cocoa.m.h) crashed when libobs is loaded from alibobs.frameworkwithout a bundle identifier (noInfo.plist): the bundle is nil, the path string is nil, andstrlen(NULL)follows. This is what crashestest_find_data_filein the macOS Rust Tier 2 stageCargo [obs-c-reference] unchanged ctest suite, whose frameworkobs-buildmakes without anInfo.plist. It blocks #2514 and every PR that selects that lane.What changed
find_libobs_data_file()returns NULL when the bundle or its path is not found.obs_find_data_file()then searches the data paths fromobs_add_data_path(), as on Linux and Windows. With the bundle present, nothing changes.docs/features.md: a line under Fixed upstream bugs, Stability (upstream OBS has the same code).RED → GREEN
test_find_data_file), and locally (macOS 26.7.1)test_obs_core_info_characterizationagainst alibobs.frameworkthat has onlyVersions/A/libobs, noInfo.plist: SIGSEGV.Info.plist8/8 (the full data-path checks run there now); the CMakelibobs-c-referenceand hybrid frameworks 7 passed plus the macOS skip oftest_find_data_file, as before.A follow-up could give the cargo-built framework an
Info.plist(stage_identityinrust/obs-build/src/platform/libobs_macos.rs), so that stage matches a real framework.Checklist
masterdocs/features.md🤖 Generated with Claude Code