Skip to content

libobs: Carry on when a core module cannot be loaded - #750

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/core-module-missing-dep
Oct 14, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/core-module-missing-dep

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

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 made obs_load_core_modules() return false, and PluginManager::loadAllPlugins() (frontend/plugin-manager/PluginManager.cpp line 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 links libcef.so directly, so an obs-browser.so installed 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.
  • Now a core module that fails to open is recorded as a disabled module (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.c line 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.

  1. test/cmocka: A core module that cannot be loaded stops OBS or the others: adds test_core_module_load (Linux). It lays out a stub module under every core module name (from the build's own obs-core-modules.c) next to a copy of the test binary, and runs obs_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, like libcef.so. 2 of 3 cases fail: missing_dependency (obs_load_core_modules() returns false) and missing_file (image-source, the core module after the missing one, isn't loaded). all_present passes.
  2. 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-git and OBS wouldn't start (libcef.so: cannot open shared object file, then "Failed to load core OBS modules"). The package installs obs-browser.so into /usr/lib/obs-modules/core/, but cef is 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.so was replaced with a stub module that needs a libcef.so that isn't installed:

  • unchanged: all core modules load (control);
  • obs-vst.so needs a missing library: Failed to load core OBS modules. OBS cannot run without these modules., and OBS exits;
  • obs-vst.so removed: 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:

Build obs-vst.so needs a missing library obs-vst.so removed
RED commit "Failed to load core OBS modules", OBS exits 12 core modules loaded (none after obs-vst)
this PR warning, the other 16 core modules load, main window opens (Switched to scene 'Scene') error logged, the other 16 core modules load, main window opens

Automated, on master a48a9a1 (C lane, ENABLE_RUST_LIBOBS OFF, 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 other obs_startup() tests.
  • Full ctest under a private Xvfb with software GL and the system libobs-opengl masked, 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) and test_startup_cycle_stress (and at RED also test_startup_alloc_stable): those two run their own nested xvfb-run and skip on this machine, on master too.
  • Rust lane (ENABLE_RUST_LIBOBS ON, which the AUR package uses): test_core_module_load 2 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.
  • clang-format and ci/test_registration.py are clean. gersemi isn't installed here (CMake change not checked by it).

Not tested:

  • A real obs-browser.so without CEF (there's no CEF on this machine); the stub fails in dlopen() the same way.
  • The failed core module is only logged. It doesn't show up in the "plugins failed to load" dialog the way an OBS 32 plugin did, because obs_load_core_modules() returns only a bool. That could be a follow-up.
  • Windows and macOS: their core module loaders also stop at a missing core module file (break / return). They are left unchanged here because I can't run them. The obs-module.c change applies to every platform.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
  • I have used AI tooling in the creation of this PR
  • I am an AI agent being used to assist with this pull request: Claude Code (Claude Opus 5.5) wrote the code, the test, the commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.

🤖 Generated with Claude Code

@rdoupe
rdoupe requested a review from zackees as a code owner October 14, 2026 17:46
@zackees zackees added the ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak label Oct 14, 2026
rdoupe and others added 2 commits October 14, 2026 11:03
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
zackees force-pushed the fix/core-module-missing-dep branch from ff425cd to 91ca9a6 Compare October 14, 2026 18:12
@zackees

zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Rebased onto master and ran the stamped local gate. Your RED/GREEN evidence above stands.

  • Rebased on master, local gate passed; pushed as 91ca9a6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak

Projects

Status: Done

2 participants