Skip to content

StackOverflowException when OSR browser gains Focus #489

Description

@nprice-flextrade

Describe the bug
While running a JCEF-based application, I noticed some unexpected messages being written to the STDERR stream (System.err)

These messages simply read Exception in thread "AWT-EventQueue-0"

After a significant amount of effort, I tracked these down to an unreported StackOverflowError, being triggered by CefClient.onGotFocus

To Reproduce
Steps to reproduce the behavior:

  1. Use the Simple example application
  2. Update useOsr to true in the main method of the MainFrame class
  3. Run the app as normal (ensuring the necessary --add-exports parameters are included for Java 9+)
  4. Observe the System.err log output contains multiple instances of Exception in thread "AWT-EventQueue-0"

Expected behavior
We shouldn't see unexpected errors...

Versions (please complete the following information):

  • OS: Windows
  • Java Version: OpenJDK 17
  • JCEF Version: 99c2f7a
  • CEF Version: 127.3.1

Additional context
Putting a breakpoint in CefClient.onGotFocus reveals that this method is triggered repeatedly, with the following stack:

onGotFocus:461, CefClient (org.cef) [39]
N_SetFocus:-1, CefBrowser_N (org.cef.browser)
setFocus:497, CefBrowser_N (org.cef.browser)
onGotFocus:461, CefClient (org.cef) [38]
...

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions