Repository navigation
libobs: Carry on when a core module cannot be loaded - #750
Merged
Merged
Conversation
test_core_module_load lays out stub modules under every core module name next to a copy of itself and runs obs_load_core_modules() in a child. When one core module is installed but a library it needs is missing (an obs-browser.so without libcef.so), the load fails as a whole and the frontend refuses to start. When one core module file is missing, the loader stops at it and silently skips every core module after it. Guard: all core modules present. Refs obs-rust#749. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A core module whose file is there but cannot be opened, most often
because a library it needs is not installed (obs-browser.so without
libcef.so), made obs_load_core_modules() fail, and the frontend then
refused to start ("Failed to load core OBS modules"). Before core
modules, the same plugin was only reported as failed and OBS ran. Record
it as a module that failed to open, log a warning and go on.
A core module that is not installed at all (left out by a package) made
the Linux loader stop, so every core module after it was silently not
loaded. Log the error and go on with the next one.
Fixes obs-rust#749.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=3f923bbe1a1ccbedacd42546a97e5c7f3761ca00 secs=545 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1792001570,"gate":"rust/all/fmt","host":"linux-x86_64","key":"fa2885feef0058d9fcfb9bdea0481975b23cfa649c1beec77dfde4f753b1954e","lane":"lint","parents":["a06daa57257ed146d6b6cc0449ce101e8cbe353e"],"secs":58,"stamp":"3b837d83ab81825b9d0a5f9f51a7eabf","tree":"3f923bbe1a1ccbedacd42546a97e5c7f3761ca00","v":1,"via":"run"}
Ci-Attestation: {"at":1792001570,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"fa2885feef0058d9fcfb9bdea0481975b23cfa649c1beec77dfde4f753b1954e","lane":"lint","parents":["a06daa57257ed146d6b6cc0449ce101e8cbe353e"],"secs":58,"stamp":"3492d495f57762ae262064837f6ecfb3","tree":"3f923bbe1a1ccbedacd42546a97e5c7f3761ca00","v":1,"via":"run"}
Ci-Attestation: {"at":1792001570,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"79a9720e140b1005003ca431e2068407235f2edc8cc29fd0540d47108c93ba45","lane":"rust-test","parents":["a06daa57257ed146d6b6cc0449ce101e8cbe353e"],"secs":125,"stamp":"54c6473075da6b52c3eedaf600752256","tree":"3f923bbe1a1ccbedacd42546a97e5c7f3761ca00","v":1,"via":"run"}
Ci-Attestation: {"at":1792001570,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"2c7852c2df469297c4eb4f916b9ff3fa2be25dca1900e2c96acb05800d296a94","lane":"cross","parents":["a06daa57257ed146d6b6cc0449ce101e8cbe353e"],"secs":113,"stamp":"7a7c907bccdb2f8294af94c334b05ed1","tree":"3f923bbe1a1ccbedacd42546a97e5c7f3761ca00","v":1,"via":"run"}
Ci-Attestation: {"at":1792001570,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"2c7852c2df469297c4eb4f916b9ff3fa2be25dca1900e2c96acb05800d296a94","lane":"cross","parents":["a06daa57257ed146d6b6cc0449ce101e8cbe353e"],"secs":113,"stamp":"7aab1f7680b317294b091a7948bee728","tree":"3f923bbe1a1ccbedacd42546a97e5c7f3761ca00","v":1,"via":"run"}
Ci-Attestation: {"at":1792001570,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"2c7852c2df469297c4eb4f916b9ff3fa2be25dca1900e2c96acb05800d296a94","lane":"cross","parents":["a06daa57257ed146d6b6cc0449ce101e8cbe353e"],"secs":113,"stamp":"7f4958826dbea9b8a06333defe068ce2","tree":"3f923bbe1a1ccbedacd42546a97e5c7f3761ca00","v":1,"via":"run"}
Ci-Attestation: {"at":1792001570,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"2c7852c2df469297c4eb4f916b9ff3fa2be25dca1900e2c96acb05800d296a94","lane":"cross","parents":["a06daa57257ed146d6b6cc0449ce101e8cbe353e"],"secs":113,"stamp":"60d2b2161e325506d82e4cd9013e290f","tree":"3f923bbe1a1ccbedacd42546a97e5c7f3761ca00","v":1,"via":"run"}
Ci-Attestation: {"at":1792001570,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"2c7852c2df469297c4eb4f916b9ff3fa2be25dca1900e2c96acb05800d296a94","lane":"cross","parents":["a06daa57257ed146d6b6cc0449ce101e8cbe353e"],"secs":113,"stamp":"dd68bc20a2f020dc98d1ca1d8bec23c2","tree":"3f923bbe1a1ccbedacd42546a97e5c7f3761ca00","v":1,"via":"run"}
Ci-Attestation: {"at":1792001570,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"2c7852c2df469297c4eb4f916b9ff3fa2be25dca1900e2c96acb05800d296a94","lane":"cross","parents":["a06daa57257ed146d6b6cc0449ce101e8cbe353e"],"secs":113,"stamp":"1df6de951aa7652fb6c094fc9b1433c5","tree":"3f923bbe1a1ccbedacd42546a97e5c7f3761ca00","v":1,"via":"run"}
Ci-Attestation: {"at":1792001570,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"92bc21f60768e6eb347cfd727bc8ab6b5c9e0544cde184b9661620e2659fc20c","lane":"tier2-linux","parents":["a06daa57257ed146d6b6cc0449ce101e8cbe353e"],"secs":249,"stamp":"7fa413137871949870953a0ff9ba02e7","tree":"3f923bbe1a1ccbedacd42546a97e5c7f3761ca00","v":1,"via":"run"}
zackees
force-pushed
the
fix/core-module-missing-dep
branch
from
October 14, 2026 18:12
ff425cd to
91ca9a6
Compare
Member
|
Rebased onto master and ran the stamped local gate. Your RED/GREEN evidence above stands.
|
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.
Description
OBS no longer refuses to start when one core module can't be loaded, and a missing core module no longer keeps the core modules after it from loading.
load_all_callback()(libobs/obs-module.c) counted a module that fails to open (MODULE_FAILED_TO_OPEN, line 533) as a load failure for every module type. For a core module that madeobs_load_core_modules()return false, andPluginManager::loadAllPlugins()(frontend/plugin-manager/PluginManager.cppline 88) then threw "Failed to load core OBS modules", so OBS exited. obs-browser is a core module whenever the build enables it, and it linkslibcef.sodirectly, so anobs-browser.soinstalled without CEF was enough (bug: vlc-video: audio meters, filters and capture callbacks see VLC audio 1-2 s early, in bursts (upstream #2406) #404, AUR package). OBS 32 loaded the same plugin as an ordinary plugin: it was listed as failed and OBS ran.OBS_MODULE_FAILED_TO_OPEN, as before), with a warning (Core module 'obs-browser' could not be opened, continuing without it), and it isn't counted as a core module failure. An incompatible version or a generic error still is.load_core_modules()(libobs/obs-core-modules-loader-nix.cline 54) stopped at the first core module whose file wasn't found, and still reported success, so every core module after it was silently not loaded. It now logs the error and goes on.The code came from upstream OBS 33 (
libobs: Add core module loading functionality, FiniteSingularity). Stock 33.0.0-rc1 and upstream master behave the same.test/cmocka: A core module that cannot be loaded stops OBS or the others: addstest_core_module_load(Linux). It lays out a stub module under every core module name (from the build's ownobs-core-modules.c) next to a copy of the test binary, and runsobs_load_core_modules()in that copy, because the loader finds core modules relative to the executable. A second stub needs a library (libobs-test-missing-dep.so) that is built without an RPATH and so can't be found at run time, likelibcef.so. 2 of 3 cases fail:missing_dependency(obs_load_core_modules()returns false) andmissing_file(image-source, the core module after the missing one, isn't loaded).all_presentpasses.libobs: Carry on when a core module cannot be loaded: 3 of 3 pass.Motivation and Context
Fixes #749.
Reported on #404: a user built the AUR package
obs-studio-rust-gitand OBS wouldn't start (libcef.so: cannot open shared object file, then "Failed to load core OBS modules"). The package installsobs-browser.sointo/usr/lib/obs-modules/core/, butcefis only a build dependency. That's a packaging slip, but it shouldn't stop OBS from starting: Browser Source is optional, and OBS 32 kept running in the same situation. The second half matters for packagers: the obvious way to split obs-browser out (leave its file out of the main package) would otherwise silently drop FFmpeg, filters, outputs, x264, websocket and the other core modules after it.Why this one: it's a user report on our own tracker, the user can't start OBS at all, and the change is small.
How Has This Been Tested?
Reproduced in the current release, AppImage v0.1.0-beta.20261014 (extracted, private Xvfb, private HOME). It has no obs-browser, so
obs-vst.sowas replaced with a stub module that needs alibcef.sothat isn't installed:obs-vst.soneeds a missing library:Failed to load core OBS modules. OBS cannot run without these modules., and OBS exits;obs-vst.soremoved: obs-websocket, obs-x264, rtmp-services and text-freetype2 (the core modules after it) aren't loaded, and OBS starts without them.The app built from this branch (C lane, RelWithDebInfo, with the frontend), same two changes:
obs-vst.soneeds a missing libraryobs-vst.soremovedSwitched to scene 'Scene')Automated, on master a48a9a1 (C lane,
ENABLE_RUST_LIBOBSOFF, unless noted):test_core_module_load: 2 of 3 fail at RED, 3 of 3 pass at GREEN. Under Xvfb all 3 cases run (no SKIPPED lines). Without a display, all 3 skip (obs_startup()fails), like the otherobs_startup()tests.libobs-openglmasked, TMPDIR unset: RED 211 of 212 (only the new test fails), GREEN 212 of 212. Skipped cases:open_crashes_without_obs_core(twice, as always) andtest_startup_cycle_stress(and at RED alsotest_startup_alloc_stable): those two run their own nestedxvfb-runand skip on this machine, on master too.ENABLE_RUST_LIBOBSON, which the AUR package uses):test_core_module_load2 of 3 fail at RED, 3 of 3 pass at GREEN. The full suite wasn't run in this lane. The change is in C code that both lanes build.ci/test_registration.pyare clean. gersemi isn't installed here (CMake change not checked by it).Not tested:
obs-browser.sowithout CEF (there's no CEF on this machine); the stub fails indlopen()the same way.obs_load_core_modules()returns only a bool. That could be a follow-up.break/return). They are left unchanged here because I can't run them. Theobs-module.cchange applies to every platform.Types of changes
Checklist:
🤖 Generated with Claude Code