OSR Integration w/ JavaFX application crashing on Linux
Posted: Wed Aug 17, 2022 1:53 pm
Hello, I'm struggling to figure out why this integration is crashing on Linux (but works on Windows).
We have an existing JavaFX application and are trying to integrate OSR using CEF C++ (note we use JNI directly and are not using JCEF).
We are only interested in receiving browser frames via OnPaint, there's no GUI for the Browser itself.
However, the application crashes randomly, typically within seconds of starting the CEF browser. It appears as though there's some conflict with the GUI layers (GTK?) as user interaction with the JavaFX UI is almost a guaranteed crash.
Am I missing some configuration for CEF/Chromium to decouple it properly from the GUI layer(s)? Ultimately, this needs to run in a headless environment, but getting it working within the JavaFX application is important.
Can anyone explain the dependence of Chromium/CEF on the GUI layers on Linux (in OSR mode), and is there a way to eliminate or manage such interaction?
Do I need to initialize CEF on a specific (gui related) thread? The CreateBrowser() function seems to indicate it can be called on any thread. Crashing occurs even if OnPaint() callback is a no-op.
Env..
Ubuntu 18.04 (VirtualBox VM)
CEF 103
settings.windowless_rendering_enabled = true;
settings.multi_threaded_message_loop = true;
settings.browser_subprocess_path = <path to cefclient>
gdb of the seg faulted thread (from the core dump) is always useless despite all other threads showing symbols. eg..
(gdb) bt
#0 0x00007fb3c0a9cbd5 in ()
#1 0x00000000c4ae2f48 in ()
#2 0x0000000000000000 in ()
We have an existing JavaFX application and are trying to integrate OSR using CEF C++ (note we use JNI directly and are not using JCEF).
We are only interested in receiving browser frames via OnPaint, there's no GUI for the Browser itself.
However, the application crashes randomly, typically within seconds of starting the CEF browser. It appears as though there's some conflict with the GUI layers (GTK?) as user interaction with the JavaFX UI is almost a guaranteed crash.
Am I missing some configuration for CEF/Chromium to decouple it properly from the GUI layer(s)? Ultimately, this needs to run in a headless environment, but getting it working within the JavaFX application is important.
Can anyone explain the dependence of Chromium/CEF on the GUI layers on Linux (in OSR mode), and is there a way to eliminate or manage such interaction?
Do I need to initialize CEF on a specific (gui related) thread? The CreateBrowser() function seems to indicate it can be called on any thread. Crashing occurs even if OnPaint() callback is a no-op.
Env..
Ubuntu 18.04 (VirtualBox VM)
CEF 103
settings.windowless_rendering_enabled = true;
settings.multi_threaded_message_loop = true;
settings.browser_subprocess_path = <path to cefclient>
gdb of the seg faulted thread (from the core dump) is always useless despite all other threads showing symbols. eg..
(gdb) bt
#0 0x00007fb3c0a9cbd5 in ()
#1 0x00000000c4ae2f48 in ()
#2 0x0000000000000000 in ()