chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.24k stars 455 forks source link

Linux: Debug failure FATAL:thread_restrictions.cc(105)] Check failed: !*GetBlockingDisallowedTls() #3369

Open magreenblatt opened 2 years ago

magreenblatt commented 2 years ago

Original report by cshorler (Bitbucket: cshorler, GitHub: cshorler).


chorler@localhost:~/projects/opt/cef_binary_103.0.12+g8eb56c7+chromium-103.0.5060.134_linux64/build/tests/cefsimple/Debug> ./cefsimple 
[0801/202033.047917:INFO:content_main_runner_impl.cc(1163)] Chrome is running in full browser mode.
[0801/202033.233024:WARNING:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
[0801/202033.197375:FATAL:thread_restrictions.cc(105)] Check failed: !*GetBlockingDisallowedTls(). Function marked as blocking was called from a scope that disallows blocking! If this task is running inside the ThreadPool, it needs to have MayBlock() in its TaskTraits. Otherwise, consider making this blocking work asynchronous or, as a last resort, you may use ScopedAllowBlocking (see its documentation for best practices).
g_blocking_disallowed 1 set by
#0 0x7f7fc7ece533 <unknown>
#1 0x7f7fc7f92907 <unknown>
<snip - 20 levels of unknown symbols>

Trace/breakpoint trap (core dumped)

Linux standard distribution:

https://cef-builds.spotifycdn.com/cef_binary_103.0.12%2Bg8eb56c7%2Bchromium-103.0.5060.134_linux64.tar.bz2

after building cefsimple with CMAKE_BUILD_TYPE=Debugand executing the above trace is seen in the terminal. (GDB gives me more info if desired)

At first glance this looks similar to this:

https://bugs.chromium.org/p/chromium/issues/detail?id=1241425

changing the build type CMAKE_BUILD_TYPE=Release

results in success, consistent with the above report.

magreenblatt commented 1 year ago

Original comment by Sunny Shah (Bitbucket: cygnus7, GitHub: cygnus7).


Is there a plan to fix this any time soon? I’m seeing the same crash with Debug builds on 107.0.5304.122. Here’s the trace printed on the command line:

[204130:204141:1216/100527.140420:ERROR:get_installed_version_linux.cc(36)] Failed to get current file version; child process replied with:
[204130:204130:1216/100527.114377:FATAL:thread_restrictions.cc(105)] Check failed: !*GetBlockingDisallowedTls(). Function marked as blocking was called from a scope that disallows blocking! If this task is running inside the ThreadPool, it needs to have MayBlock() in its TaskTraits. Otherwise, consider making this blocking work asynchronous or, as a last resort, you may use ScopedAllowBlocking (see its documentation for best practices).
g_blocking_disallowed 1 set by
#0 0x7f371f46dc13 base::debug::StackTrace::StackTrace()
#1 0x7f371f529737 base::DisallowBlocking()
#2 0x7f371f52ae20 base::DisallowUnresponsiveTasks()
#3 0x7f371c5ab0d3 content::BrowserMainLoop::PreMainMessageLoopRun()
#4 0x7f371cc277d6 content::StartupTaskRunner::RunAllTasksNow()
#5 0x7f371c5aabc8 content::BrowserMainLoop::CreateStartupTasks()
#6 0x7f371c5ad62a content::BrowserMainRunnerImpl::Initialize()
#7 0x7f371ab09f5f CefMainRunner::RunMainProcess()
#8 0x7f371abac56d ChromeMainDelegateCef::RunProcess()
#9 0x7f371f3e5572 content::RunBrowserProcessMain()
#10 0x7f371f3e6d71 content::ContentMainRunnerImpl::RunBrowser()
#11 0x7f371f3e6a55 content::ContentMainRunnerImpl::Run()
#12 0x7f371f3e3d20 content::ContentMainRun()
#13 0x7f371ab08d4e CefMainRunner::ContentMainRun()
#14 0x7f371ab08ae0 CefMainRunner::Initialize()
#15 0x7f371aad507b CefContext::Initialize()
#16 0x7f371aad4d5d CefInitialize()
#17 0x7f371a9d3edd cef_initialize
#18 0x561e82564d02 CefInitialize()
#19 0x561e82525f8d main
#20 0x7f3717b5cd0a __libc_start_main

What is an alternative way to debug CEF in the meantime? This crash would mask other crashes in our code, and since we can’t get past the former, we’re unable to debug or even observe any in the latter category.

magreenblatt commented 1 year ago

What is the call stack leading to AssertBlockingAllowed?

magreenblatt commented 1 year ago

Original comment by cshorler (Bitbucket: cshorler, GitHub: cshorler).


I updated to the binary release 108.

the last occurrence before the crash dump is this:

Thread 1 "cefsimple" hit Breakpoint 2, 0x00007ffff077c734 in AssertBlockingAllowed () at ../../base/threading/thread_restrictions.cc:101
101     in ../../base/threading/thread_restrictions.cc
#0  0x00007ffff077c734 in AssertBlockingAllowed() () at ../../base/threading/thread_restrictions.cc:101
#1  0x00007ffff07769d9 in ScopedBlockingCall() () at ../../base/threading/scoped_blocking_call.cc:44
#2  0x00007ffff1df0d00 in Connect() () at ../../dbus/bus.cc:376
#3  0x00007ffff1e03ed2 in CallMethodAndBlockWithErrorDetails() () at ../../dbus/object_proxy.cc:140
#4  0x00007ffff1e04602 in dbus::ObjectProxy::CallMethodAndBlock(dbus::MethodCall*, int) () at ../../dbus/object_proxy.cc:175
#5  0x00007ffff269fe43 in IsEnabled() () at ../../components/os_crypt/kwallet_dbus.cc:97
#6  0x00007ffff269e9df in InitWallet() () at ../../components/os_crypt/key_storage_kwallet.cc:57
#7  0x00007ffff269e986 in InitWithKWalletDBus() () at ../../components/os_crypt/key_storage_kwallet.cc:46
#8  0x00007ffff269b591 in WaitForInitOnTaskRunner() () at ../../components/os_crypt/key_storage_linux.cc:224
#9  0x00007ffff269b354 in CreateServiceInternal() () at ../../components/os_crypt/key_storage_linux.cc:204
#10 0x00007ffff269adac in CreateService() () at ../../components/os_crypt/key_storage_linux.cc:132
#11 0x00007ffff269cbfb in CreateKeyStorage() () at ../../components/os_crypt/os_crypt_linux.cc:271
#12 0x00007ffff269c98f in Run () at ../../base/functional/callback.h:145
#13 GetPasswordV11() () at ../../components/os_crypt/os_crypt_linux.cc:297
#14 0x00007ffff269c599 in GetRawEncryptionKey() () at ../../components/os_crypt/os_crypt_linux.cc:244
#15 0x00007ffff269c569 in GetRawEncryptionKey() () at ../../components/os_crypt/os_crypt_linux.cc:85
#16 0x00007ffff2be7992 in OnNetworkServiceCreated() () at ../../chrome/browser/net/system_network_context_manager.cc:671
#17 0x00007fffebb80c01 in AlloyContentBrowserClient::OnNetworkServiceCreated(network::mojom::NetworkService*) () at ../../cef/libcef/browser/alloy/alloy_content_browser_client.cc:1207
#18 0x00007fffeec46c9b in GetNetworkService() () at ../../content/browser/network_service_instance_impl.cc:644
#19 0x00007fffeec474a5 in BindNetworkChangeManagerReceiver() () at ../../content/browser/network_service_instance_impl.cc:424
#20 0x00007fffee851511 in Invoke<void (* const&)(mojo::PendingReceiver<audio::mojom::SystemInfo>), mojo::PendingReceiver<audio::mojom::SystemInfo> > () at ../../base/functional/bind_internal.h:5
37
#21 MakeItSo<void (*const &)(mojo::PendingReceiver<audio::mojom::SystemInfo>), const std::Cr::tuple<> &, mojo::PendingReceiver<audio::mojom::SystemInfo> > () at ../../base/functional/bind_intern
al.h:826                                                                                                                                                                                           
#22 RunImpl<void (*const &)(mojo::PendingReceiver<audio::mojom::SystemInfo>), const std::Cr::tuple<> &> () at ../../base/functional/bind_internal.h:920
#23 Run() () at ../../base/functional/bind_internal.h:884
#24 0x00007fffeba807e5 in Run() () at ../../base/functional/callback.h:267
#25 0x00007ffff1b5da67 in Initialize() () at ../../services/network/public/cpp/network_connection_tracker.cc:172
#26 0x00007ffff1b5d965 in NetworkConnectionTracker() () at ../../services/network/public/cpp/network_connection_tracker.cc:51
#27 0x00007fffeec47462 in GetNetworkConnectionTracker() () at ../../content/browser/network_service_instance_impl.cc:676
#28 0x00007fffee8927b2 in BackgroundSyncNetworkObserver() () at ../../content/browser/background_sync/background_sync_network_observer.cc:34
#29 0x00007fffee883beb in make_unique<content::BackgroundSyncNetworkObserver, base::RepeatingCallback<void ()> > () at ../../buildtools/third_party/libc++/trunk/include/__memory/unique_ptr.h:670
#30 BackgroundSyncManager() () at ../../content/browser/background_sync/background_sync_manager.cc:672
#31 0x00007fffee880676 in Create() () at ../../content/browser/background_sync/background_sync_manager.cc:382
#32 0x00007fffee8802dd in CreateBackgroundSyncManager() () at ../../content/browser/background_sync/background_sync_context_impl.cc:191
#33 0x00007fffee87fb27 in Init() () at ../../content/browser/background_sync/background_sync_context_impl.cc:62
#34 0x00007fffeef9e6b0 in Initialize() () at ../../content/browser/storage_partition_impl.cc:1307
#35 0x00007fffeefb165b in Get() () at ../../content/browser/storage_partition_impl_map.cc:351
#36 0x00007fffee8cfe41 in GetStoragePartition () at ../../content/browser/browser_context.cc:138
#37 GetStoragePartition() () at ../../content/browser/browser_context.cc:127
#38 0x00007fffeee737bf in MaybeTakeSpareRenderProcessHost () at ../../content/browser/renderer_host/render_process_host_impl.cc:528
#39 GetProcessHostForSiteInstance() () at ../../content/browser/renderer_host/render_process_host_impl.cc:4533
#40 0x00007fffeef8113c in GetProcess() () at ../../content/browser/site_instance_impl.cc:375
#41 0x00007fffeee4bb5f in CreateRenderFrameHost() () at ../../content/browser/renderer_host/render_frame_host_manager.cc:2765
#42 0x00007fffeee4b9ed in InitRoot() () at ../../content/browser/renderer_host/render_frame_host_manager.cc:388
#43 0x00007fffeed0e4ea in Init() () at ../../content/browser/renderer_host/frame_tree.cc:797
#44 0x00007fffeefe76dd in Init() () at ../../content/browser/web_contents/web_contents_impl.cc:3083
#45 0x00007fffeefdabc6 in CreateWithOpener() () at ../../content/browser/web_contents/web_contents_impl.cc:1139
#46 0x00007fffebb8725c in CreateWebContents() () at ../../cef/libcef/browser/alloy/browser_platform_delegate_alloy.cc:94
#47 0x00007fffebb75339 in Create() () at ../../cef/libcef/browser/alloy/alloy_browser_host_impl.cc:112
#48 0x00007fffebba0147 in Create () at ../../cef/libcef/browser/browser_host_create.cc:172
#49 CreateBrowserSync() () at ../../cef/libcef/browser/browser_host_create.cc:149
#50 0x00007fffebba05ba in Run() () at ../../cef/libcef/browser/browser_host_create.cc:32
#51 0x00007ffff0728b8c in Run () at ../../base/functional/callback.h:145
#52 RunTaskImpl() () at ../../base/task/common/task_annotator.cc:133
#53 0x00007ffff074dd23 in RunTask<(lambda at ../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:443:29)> () at ../../base/task/common/task_annotator.h:72
#54 DoWorkImpl() () at ../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:441
#55 0x00007ffff074d199 in DoWork() () at ../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:297
#56 0x00007ffff074e6e5 in non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() () at ../../buildtools/third_party/libc++/trunk/include/atomic:954
#57 0x00007ffff06dfab1 in Run() () at ../../base/message_loop/message_pump_glib.cc:404
#58 0x00007ffff074ec39 in Run() () at ../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:600
#59 0x00007ffff0708b7b in Run() () at ../../base/run_loop.cc:141
#60 0x00007fffebbf1b23 in RunMessageLoop() () at ../../cef/libcef/browser/main_runner.cc:281
#61 0x00007fffebbbcabe in RunMessageLoop () at ../../cef/libcef/browser/context.cc:482
#62 CefRunMessageLoop() () at ../../cef/libcef/browser/context.cc:359
#63 0x00000000004622ed in CefRunMessageLoop() () at /home/chorler/projects/opt/cef_binary_108.4.13+ga98cd4c+chromium-108.0.5359.125_linux64/libcef_dll/wrapper/libcef_dll_wrapper.cc:131
#64 0x0000000000421b15 in main(int, char**) (argc=1, argv=0x7fffffffd738) at /home/chorler/projects/opt/cef_binary_108.4.13+ga98cd4c+chromium-108.0.5359.125_linux64/tests/cefsimple/cefsimple_lin
ux.cc:85

magreenblatt commented 1 year ago

Original comment by cshorler (Bitbucket: cshorler, GitHub: cshorler).


  <div class="preview-container wiki-content"><!-- loaded via ajax --></div>
  <div class="mask"></div>
</div>

magreenblatt commented 1 year ago

Original comment by Mor (Bitbucket: mohot, GitHub: mohot).


Same issue. @cshorler, do you found any solution?

magreenblatt commented 2 years ago
magreenblatt commented 1 year ago

Original changes by cshorler (Bitbucket: cshorler, GitHub: cshorler).