Skip to content

fix(shell): no stack protector on the CEF subprocess entry path - #1854

Open
noquierouser wants to merge 1 commit into
CasparCG:masterfrom
noquierouser:fix/cef-subprocess-stack-protector
Open

noquierouser wants to merge 1 commit into
CasparCG:masterfrom
noquierouser:fix/cef-subprocess-stack-protector

Conversation

@noquierouser

@noquierouser noquierouser commented Nov 25, 2026 •

Copy link
Copy Markdown

CEF subprocesses are forked from Chromium's zygote, which replaces the stack canary in the child. main(), intercept_command_line_args() and html::intercept_command_line() are live across that fork, so when CefExecuteProcess() returns they check the old canary and glibc aborts with "stack smashing detected".

This marks those three frames no_stack_protector, as Chromium and CEF's sample apps do for their entry points. It addresses the cause behind #1781, complementing the workaround in #1773.

Tested as a downstream patch on v2.5.1 together with the #1773 backport, on Fedora 43/44/45 and EL10 (built with -fstack-protector-strong): 15–33 aborts per 2-minute run before, none after. Not yet built against master.

Summary by CodeRabbit

  • Chores
    • Updated platform-specific build handling for certain GCC builds. These changes affect application startup internals and do not add or remove user-facing features. No changes to the application’s visible functionality are described in this release.

CEF subprocesses (--type=utility etc.) are forked from Chromium's zygote,
which then replaces the stack canary in the child. main(),
intercept_command_line_args() and html::intercept_command_line() are live
across that fork, so when the subprocess finishes and CefExecuteProcess()
returns, their epilogues compare against the old canary and glibc aborts
with "*** stack smashing detected ***" (SIGABRT and a core dump on every
utility process exit: Unzipper, DataDecoderService, OnDeviceModelService).

Builds using -fstack-protector-strong are affected, which is the default
in distro packaging flags. Mark the three frames no_stack_protector, as
Chromium and CEF's sample applications do for their entry points.

This addresses the cause of CasparCG#1781. CasparCG#1773 worked around it by disabling
the component updater and passing change-stack-guard-on-fork=disable.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Three functions receive GCC no_stack_protector annotations on non-Windows builds. Comments in the shell code describe stack-canary behavior in CEF subprocesses forked from the Chromium zygote.

Changes: Compiler annotations

Layer / File(s) Summary
Conditional function annotations
src/modules/html/html.cpp, src/shell/included_modules.tmpl, src/shell/main.cpp
intercept_command_line, intercept_command_line_args, and main receive no_stack_protector annotations on GCC non-Windows builds. Comments describe the CEF zygote context.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: julusian, dedicatedbroadcastsolutions

Merge Risk: Minimal · up to fd55b

This change disables stack-protector checks on three functions to avoid spurious aborts in CEF subprocesses forked from the zygote. It is limited to GCC non-Windows builds, and no concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: adding the no_stack_protector attribute to the CEF subprocess entry path so stack-canary checks no longer abort subprocesses after CefExecuteProcess() returns. The raw…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: adding the no_stack_protector attribute to the CEF subprocess entry path so stack-canary checks no longer abort subprocesses after CefExecuteProcess() returns. The raw summary confirms the attribute is applied to main(), intercept_command_line_args(), and html::intercept_command_line(), which matches the title's scope. The title uses the conventional fix(scope) form and is concise.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e2aa8e6b-f428-4298-92ef-6744ee828745
Commits

Reviewing files that changed from the base of the PR and between 31b6ef7 and fd55b8d.

Files selected for processing: 3

  • src/modules/html/html.cpp
  • src/shell/included_modules.tmpl
  • src/shell/main.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

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.

1 participant