Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/modules/html/html.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ class renderer_application
IMPLEMENT_REFCOUNTING(renderer_application);
};

// See main() in shell/main.cpp: must not carry a stack protector across the
// CEF zygote fork.
#if defined(__GNUC__) && !defined(_WIN32)
__attribute__((no_stack_protector))
#endif
bool intercept_command_line(int argc, char** argv)
{
#ifdef _WIN32
Expand Down
4 changes: 4 additions & 0 deletions src/shell/included_modules.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ ${CASPARCG_MODULE_INCLUDE_STATEMENTS}

namespace caspar {

// See main(): must not carry a stack protector across the CEF zygote fork.
#if defined(__GNUC__) && !defined(_WIN32)
__attribute__((no_stack_protector))
#endif
static bool intercept_command_line_args(int argc, char** argv)
{${CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS}
return false;
Expand Down
8 changes: 8 additions & 0 deletions src/shell/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ void terminate_handler()

} // namespace caspar

// CEF subprocesses forked from Chromium's zygote get a new stack canary in the
// child unless change-stack-guard-on-fork=disable takes effect. Every frame that was live across
// that fork still holds the old canary, so returning through it with a stack
// protector aborts with "stack smashing detected". Chromium and CEF's own
// sample apps mark their entry points NO_STACK_PROTECTOR for this reason.
#if defined(__GNUC__) && !defined(_WIN32)
__attribute__((no_stack_protector))
#endif
int main(int argc, char** argv)
{
using namespace caspar;
Expand Down