Open antoyo opened 4 years ago
I haven't seen that one. Maybe you could try turning off the sandbox feature (in CefSettings) to see if that fixes the example?
Can you tell me which file I need to edit?
Here are the settings: https://github.com/anlumo/cef/blob/8841465178fecac6176ed9fe0e7163d784144d66/examples/cefsimple/main.rs#L46
Note that I haven't tested the cefsimple example in a while.
As far as I understand the code, this example is already supposed to disable the sandbox because Context::initialize
is called with the sandbox_info
argument being None
which in turns call to_cef()
with sandbox_info.is_some()
as the use_sandbox
argument.
Am I mistaken or should I do something else to disable the sandbox?
I believe that specific parameter is only relevant to Windows.
I still don't understand. Can you tell me what should I change in the code please?
Hmm I just dove through the extraction of the settings and you're right, @Osspial changed it so that this parameter actually turns off the sandbox on all platforms.
@Osspial maybe you have an idea what's wrong?
Any news on that? Is there any way I can help you debug this?
Could you try updating to the latest master? It looks like there was a memory management bug in BrowserHost::create_browser_sync
.
It seems to be fixed, but now it segfaults in libcef.so
.
Do I need to use the same CEF version as you (I read something about that when I was trying myself to create a libcef binding for Rust)?
If so, could you please write in the readme the exact version of CEF this crate is for?
Well, sometimes CEF versions add incompatible changes, but most are compatible to each other. We're currently using version 79.1.26+g50b44dc+chromium-79.0.3945.117
.
I've tried updating to a newer version, but the C++ code doesn't compile for me any more for some reason. I have to look into this when I have some time.
@antoyo Could you post a stacktrace with the new segfault? I'm not entirely sure how to get symbols in libcef
to show up the stack trace, but it'd be helpful to get those.
When I run in debug mode, it doesn't segfault, but does not work either:
[0418/120638.395207:INFO:content_main_runner_impl.cc(957)] Chrome is running in full browser mode.
[0418/120638.426021:INFO:main.rs(54)] Startup
[0418/120638.426091:INFO:main.rs(69)] Opening browser window
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 42 (X_SetInputFocus)
Serial number of failed request: 292
Current serial number in output stream: 294
[0418/120638.448155:FATAL:context.cc(58)] Check failed: !g_context. CefShutdown was not called
[0418/120638.483493:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[0418/120638.645263:INFO:child_thread_impl.cc(831)] ChildThreadImpl::EnsureConnected()
[0418/120638.673531:INFO:child_thread_impl.cc(831)] ChildThreadImpl::EnsureConnected()
fish: 'cargo run --example cefsimple' terminated by signal SIGTRAP (Trace or breakpoint trap)
I'm having a hard time compiling CEF with the options I want, but I think this time I was able to disable the sandbox as well.
Can I provide more info?
Hmm. It's not clear whether or not that's an error on our part - can you try running the official cefsimple
example from here and see if that results in the same error?
The cefsimple
example from my installation works.
From what I found on the web, that might be related to focusing the window at the wrong moment.
I'll try to investigate that.
Can you point me to where in the code is the focusing done?
Hmm I'm having similar issues running cefsimple
I've been able to reproduce the X error on my system. Could you check to see if cefsimple
works on the latest master?
Yeah, now the window is shown. Thanks for the fix.
There's an issue on exit, I think:
woo linux
[0701/111718.924984:WARNING:resource_bundle.cc(1078)] unable to find resource: 10000
[0701/111718.925295:WARNING:resource_bundle.cc(1078)] unable to find resource: 15090
[0701/111718.925320:WARNING:resource_bundle.cc(1078)] unable to find resource: 15090
[0701/111718.925364:WARNING:resource_bundle.cc(1078)] unable to find resource: 15091
[0701/111718.925418:WARNING:resource_bundle.cc(1078)] unable to find resource: 10100
[0701/111718.925444:WARNING:resource_bundle.cc(1078)] unable to find resource: 10101
[0701/111718.925470:WARNING:resource_bundle.cc(1078)] unable to find resource: 10102
[0701/111718.925495:WARNING:resource_bundle.cc(1078)] unable to find resource: 10103
[0701/111718.925520:WARNING:resource_bundle.cc(1078)] unable to find resource: 10105
[0701/111718.925544:WARNING:resource_bundle.cc(1078)] unable to find resource: 10106
[0701/111718.925567:WARNING:resource_bundle.cc(1078)] unable to find resource: 10107
[0701/111718.926265:WARNING:resource_bundle.cc(1078)] unable to find resource: 10108
[0701/111718.926292:WARNING:resource_bundle.cc(1078)] unable to find resource: 10109
[0701/111718.928564:INFO:main.rs(88)] Startup
[0701/111718.928623:INFO:main.rs(103)] Opening browser window
[0701/111718.939241:WARNING:main.rs(44)] X error received:
type 0
serial 292
error_code 8
request_code 42
minor_code 0
[0701/111718.948279:INFO:main.rs(115)] Running message loop
[0701/111718.970041:WARNING:resource_bundle.cc(1078)] unable to find resource: 27303
[0701/111718.970100:WARNING:resource_bundle.cc(1078)] unable to find resource: 27304
[0701/111718.971121:WARNING:resource_bundle.cc(1078)] unable to find resource: 27303
[0701/111718.971168:WARNING:resource_bundle.cc(1078)] unable to find resource: 27304
[0701/111719.006685:ERROR:sandbox_linux.cc(372)] InitializeSandbox() called with multiple threads in process gpu-process.
[0701/111719.036092:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
drop poisoned
[0701/111720.134869:WARNING:main.rs(44)] X error received:
type 0
serial 400
error_code 3
request_code 20
minor_code 0
[0701/111720.135172:WARNING:main.rs(44)] X error received:
type 0
serial 401
error_code 3
request_code 129
minor_code 1
[0701/111720.137661:INFO:main.rs(119)] Quit
drop context
fish: 'cargo run --bin cefsimple' terminated by signal SIGTRAP (Trace or breakpoint trap)
That error is caused by something not cleaning up all objects that were created for CEF.
Hi. Here's the stacktrace in gdb:
Here are the logs (change at every execution):
Any idea of what could be the issue? Thanks.