CEF is crashing when calling CefShutdown from within our client-application on linux. We have ensured that the initialization/deinitialization takes place in the same thread. We are using a foreign Eventloop (QEventLoop, QApplication) and trigger the call to CefDoMessageLoopWork every 50ms.
Basically the code looks like:
CefInitialize(...)
CreateBrowser(...)
EventLoop.exec()
CefShutdown()
When the close button (X) is clicked, ClientHandler::OnBeforeClose is called which triggers a signal to exit the EventLoop.
Following the application output:
[0915/105446.791234:ERROR:gl_surface_egl.cc(780)] EGL Driver message (Critical) eglMakeCurrent: Failed to make the GLX context current
[0915/105446.791474:ERROR:skia_output_surface_impl_on_gpu.cc(1521)] Failed to make current.
[0915/105446.791684:ERROR:skia_output_surface_impl_on_gpu.cc(1521)] Failed to make current.
[0915/105446.797629:WARNING:connection.cc(61)] X error received. Request: DestroyWindowRequest, Error: WindowError{.sequence = 348, .bad_value = 37748738, .minor_opcode = 0, .major_opcode = 4}
[0915/105446.799032:FATAL:alloy_browser_main.cc(246)] Check failed: global_request_context_->HasOneRef().
Thread 1 "CEFViewer" received signal SIGTRAP, Trace/breakpoint trap.
0x00007fffef159e37 in operator() () at ../../base/logging.cc:889
889 ../../base/logging.cc: Datei oder Verzeichnis nicht gefunden.
Missing separate debuginfos, use: zypper install kdebase4-workspace-libs-debuginfo-4.11.22-2.8.x86_64 libX11-xcb1-debuginfo-1.6.2-12.15.1.x86_64
(gdb) bt
#0 0x00007fffef159e37 in operator() () at ../../base/logging.cc:889
#1 0x00007fffef159e37 in ~LogMessage() () at ../../base/logging.cc:889
#2 0x00007fffef15a0ee in logging::LogMessage::~LogMessage() () at ../../base/logging.cc:583
#3 0x00007fffeefc9358 in PostMainMessageLoopRun() () at ../../cef/libcef/browser/alloy/alloy_browser_main.cc:246
#4 0x00007fffec58aa77 in ShutdownThreadsAndCleanUp() () at ../../content/browser/browser_main_loop.cc:1036
#5 0x00007fffec58c519 in Shutdown() () at ../../content/browser/browser_main_runner_impl.cc:179
#6 0x00007fffef021c2c in FinalizeShutdown() () at ../../cef/libcef/browser/main_runner.cc:496
#7 0x00007fffef021af2 in Shutdown() () at ../../cef/libcef/browser/main_runner.cc:274
#8 0x00007fffeeff2f8a in Shutdown() () at ../../cef/libcef/browser/context.cc:386
#9 0x00007fffeeff2e0d in CefShutdown() () at ../../cef/libcef/browser/context.cc:233
#10 0x000000000041cb36 in CEF::DeinitializeCEF() () at CEFClientApp.cc:260
#11 0x0000000000415651 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at CEFViewer.cc:125
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7ffff7f3f6c0 (LWP 24104) "CEFViewer" 0x00007fffef159e37 in operator() () at ../../base/logging.cc:889
2 Thread 0x7fffce081700 (LWP 24118) "sandbox_ipc_thr" 0x00007fffe408f6fd in poll () from /lib64/libc.so.6
3 Thread 0x7fffcd880700 (LWP 24148) "CEFViewer" 0x00007ffff63137c6 in waitpid () from /lib64/libpthread.so.0
4 Thread 0x7fffcd07f700 (LWP 24149) "ThreadPoolServi" 0x00007fffe40988b3 in epoll_wait () from /lib64/libc.so.6
5 Thread 0x7fffcc87e700 (LWP 24150) "ThreadPoolForeg" 0x00007ffff6310438 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
6 Thread 0x7fffcc07d700 (LWP 24151) "ThreadPoolForeg" 0x00007ffff6310438 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
7 Thread 0x7fffcb87c700 (LWP 24152) "Chrome_IOThread" 0x00007fffe40988b3 in epoll_wait () from /lib64/libc.so.6
8 Thread 0x7fffcb07b700 (LWP 24153) "MemoryInfra" 0x00007ffff631008f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
9 Thread 0x7fffca6db700 (LWP 24154) "ThreadPoolForeg" 0x00007ffff6310438 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
10 Thread 0x7fffc9eda700 (LWP 24155) "ThreadPoolForeg" 0x00007ffff6310438 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
11 Thread 0x7fffc96d9700 (LWP 24156) "inotify_reader" 0x00007fffe408f6fd in poll () from /lib64/libc.so.6
12 Thread 0x7fffc8ed8700 (LWP 24157) "ThreadPoolForeg" 0x00007ffff6310438 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
13 Thread 0x7fffc86d7700 (LWP 24158) "CompositorTileW" 0x00007ffff631008f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
14 Thread 0x7fffc7eb6700 (LWP 24159) "VideoCaptureThr" 0x00007ffff631008f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
15 Thread 0x7fffc76b5700 (LWP 24160) "ThreadPoolSingl" 0x00007ffff631008f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
16 Thread 0x7fffc6eb4700 (LWP 24162) "ThreadPoolSingl" 0x00007ffff631008f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
17 Thread 0x7fffc61c8700 (LWP 24167) "CacheThread_Blo" 0x00007fffe40988b3 in epoll_wait () from /lib64/libc.so.6
We encounter this problem since we have updgraded CEF from 3.2275 to 93.1.11 and we are doing nothing special with the global request context within our implementation. cefsimple does not crash on exit. Any suggestion would be very appreciated.