Skip to content

frontend: Queue navigation in auth window to fix crash - #14072

Open
WizardCM wants to merge 2 commits into
obsproject:masterfrom
WizardCM:fix-service-login-crash
Open

WizardCM wants to merge 2 commits into
obsproject:masterfrom
WizardCM:fix-service-login-crash

Conversation

@WizardCM

Copy link
Copy Markdown
Member

Description

Queue navigation of service integration login window.

Motivation and Context

Qt and CEF like to fight each other's queues.

Fixes a crash when attempting to log into Twitch Service Integration.

Fix found by @prgmitchell and verified by both Mitchell and myself.

How Has This Been Tested?

Log into Twitch on macOS.

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.

@WizardCM WizardCM added kind/bug Categorizes issue or PR as related to a bug. platform/macos Categorizes issue or PR as affecting macOS specifically labels Oct 24, 2026
@PatTheMav

Copy link
Copy Markdown
Member

Would be great if the commit message would also go into detail what the issue is and why this fixes it.

Feel free to copy this:

When the browser panel inside the OAuth dialog navigates to a new URL, it calls the navigation URL handler from its own event loop. The OAuth dialog has installed such a handler to check each navigation event's URL for a possible "code" argument.

If such a "code" argument is found, the dialog's "accept" method is called, which in turn will call "closeBrowser" as the dialog attempts to close itself.

This results in browser shutdown code running in the middle of CEF draining its main event loop of pending tasks.

After the switch to the Chromium runtime this now results in a crash within CEF's "InterceptNavigationThrottle" destructor, which is executed as part of the browser shutdown.

Decoupling the URL change handler of the dialog from the URL change handler of the browser panel ensures that the browser shutdown is initiated from the Qt main event loop and not the CEF main event loop and resolves the issue.

When the browser panel inside a dialog navigates to a new URL,
it calls the navigation URL handler from its own event loop. The OAuth
dialog has installed such a handler to check each navigation event's URL
for a possible "code" argument.
If such a "code" argument is found, the dialog's "accept" method is
called, which in turn will call "closeBrowser" as the dialog attempts
to close itself.

This results in browser shutdown code running in the middle of CEF
draining its main event loop of pending tasks.

In the Chrome Runtime this now results in a crash within CEF's
"InterceptNavigationThrottle" destructor, which is executed as part of
the browser shutdown.

Decoupling the URL change handler of the dialog from the URL change
handler of the browser panel ensures that the browser shutdown is
initiated from the Qt main event loop and not the CEF main event loop
and resolves the issue.

This branch has not been deployed

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

Labels

kind/bug Categorizes issue or PR as related to a bug. platform/macos Categorizes issue or PR as affecting macOS specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants