TS_PROCESS_CRASHED crashing render thread

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

TS_PROCESS_CRASHED crashing render thread

Postby Hemmy » Mon Oct 19, 2020 6:16 am

Hi there,
I’m trying out CEF in an existing application with its own message loop. Everything appeared to work correctly at first, but on closer inspection, render threads were terminating in the background, making webpages nonresponsive and some webpages not load at all.
I’m listening to crashes using CefRequestHandler::OnRenderProcessTerminated which reports crashes with the status “TS_PROCESS_CRASHED”. I’m also listening to any exceptions with CefRenderHandler::OnUncaughtException, however this doesn’t fire at anytime in the execution.

A few notes on my implementation:
I have a class ChromiumClient which inherits from CefApp and CefBrowserProcessHandler. This handles the communication between the main application and CEF.
ChromiumClient uses a ChromiumHandler class which deals with all the callbacks from cef (inherits from CefClient, CefLifeSpanHandler, CefRenderHandler, CefLoadHandler, CefRequestHandler, CefDisplayHandler, CefRenderPrrocessHandler).

Would anyone have any suggestions on where I could go from here?

Thanks,
Hemmy
Newbie
 
Posts: 6
Joined: Mon Oct 19, 2020 4:43 am

Re: TS_PROCESS_CRASHED crashing render thread

Postby magreenblatt » Mon Oct 19, 2020 10:39 am

What OS and CEF version? You should attach a debugger to the renderer process to find out why it's crashing. Debugging symbols are available from the same download location as the binary distributions.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: TS_PROCESS_CRASHED crashing render thread

Postby Hemmy » Tue Oct 20, 2020 3:11 am

I'm on Windows 10 and I'm using on version 85.3.6+gacfac2f+chromium-85.0.4183.102. The process appears to crash in blink on "CHECK(U_SUCCESS(error_code) && iterator)".

Code: Select all
static TextBreakIterator* GetNonSharedCharacterBreakIterator() {
  DEFINE_THREAD_SAFE_STATIC_LOCAL(
      ThreadSpecific<std::unique_ptr<TextBreakIterator>>, thread_specific, ());

  std::unique_ptr<TextBreakIterator>& iterator = *thread_specific;

  if (!iterator) {
    ICUError error_code;
    iterator = base::WrapUnique(icu::BreakIterator::createCharacterInstance(
        icu::Locale(CurrentTextBreakLocaleID()), error_code));
    CHECK(U_SUCCESS(error_code) && iterator)
        << "ICU could not open a break iterator: " << u_errorName(error_code)
        << " (" << error_code << ")";
  }

  DCHECK(iterator);
  return iterator.get();
}
Hemmy
Newbie
 
Posts: 6
Joined: Mon Oct 19, 2020 4:43 am

Re: TS_PROCESS_CRASHED crashing render thread

Postby magreenblatt » Tue Oct 20, 2020 10:36 am

What is the symbolized call stack for the crash?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: TS_PROCESS_CRASHED crashing render thread

Postby Hemmy » Tue Oct 20, 2020 11:22 am

Ah sorry, I should have included that in the last post. Here's the callstack:

Code: Select all
>   [Inline Frame] libcef.dll!blink::GetNonSharedCharacterBreakIterator() Line 736   C++
    libcef.dll!blink::NonSharedCharacterBreakIterator::CreateIteratorForBuffer(const wchar_t * buffer, unsigned int length) Line 783   C++
    libcef.dll!blink::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(const WTF::StringView & string) Line 765   C++
    libcef.dll!blink::NumGraphemeClusters(const WTF::String & string) Line 47   C++
    [Inline Frame] libcef.dll!blink::MakeVisibleEmptyValue(const WTF::Vector<WTF::String,0,WTF::PartitionAllocator> & symbols) Line 40   C++
    libcef.dll!blink::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement(blink::Document & document, blink::DateTimeFieldElement::FieldOwner & field_owner, blink::DateTimeField type, const WTF::Vector<WTF::String,0,WTF::PartitionAllocator> & symbols, int minimum, int maximum) Line 62   C++
    libcef.dll!blink::DateTimeSymbolicMonthFieldElement::DateTimeSymbolicMonthFieldElement(blink::Document & document, blink::DateTimeFieldElement::FieldOwner & field_owner, const WTF::Vector<WTF::String,0,WTF::PartitionAllocator> & labels, int minimum, int maximum) Line 569   C++
    libcef.dll!blink::DateTimeEditBuilder::VisitField(blink::DateTimeFormat::FieldType field_type, int count) Line 273   C++
    libcef.dll!blink::DateTimeFormat::Parse(const WTF::String & source, blink::DateTimeFormat::TokenHandler & token_handler) Line 197   C++
    [Inline Frame] libcef.dll!blink::DateTimeEditBuilder::Build(const WTF::String & format_string) Line 145   C++
    libcef.dll!blink::DateTimeEditElement::GetLayout(const blink::DateTimeEditElement::LayoutParameters & layout_parameters, const blink::DateComponents & date_value) Line 747   C++
    libcef.dll!blink::DateTimeEditElement::SetEmptyValue(const blink::DateTimeEditElement::LayoutParameters & layout_parameters, const blink::DateComponents & date_for_read_only_field) Line 828   C++
    libcef.dll!blink::MultipleFieldsTemporalInputTypeView::UpdateView() Line 607   C++
    libcef.dll!blink::MultipleFieldsTemporalInputTypeView::DidSetValue(const WTF::String & sanitized_value, bool value_changed) Line 559   C++
    libcef.dll!blink::HTMLInputElement::setValue(const WTF::String & value, blink::TextFieldEventBehavior event_behavior, blink::TextControlSetValueSelection selection) Line 1166   C++
    libcef.dll!blink::HTMLInputElement::UpdateType() Line 519   C++
    libcef.dll!blink::HTMLInputElement::ParseAttribute(const blink::Element::AttributeModificationParams & params) Line 767   C++
    libcef.dll!blink::Element::AttributeChanged(const blink::Element::AttributeModificationParams & params) Line 2382   C++
    libcef.dll!blink::HTMLElement::AttributeChanged(const blink::Element::AttributeModificationParams & params) Line 689   C++
    libcef.dll!blink::HTMLFormControlElement::AttributeChanged(const blink::Element::AttributeModificationParams & params) Line 110   C++
    [Inline Frame] libcef.dll!blink::Element::DidModifyAttribute(const blink::QualifiedName & name, const WTF::AtomicString & old_value, const WTF::AtomicString & new_value) Line 5781   C++
    [Inline Frame] libcef.dll!blink::Element::SetAttributeInternal(unsigned int index, const blink::QualifiedName & name, const WTF::AtomicString & new_value, blink::Element::SynchronizationOfLazyAttribute in_synchronization_of_lazy_attribute) Line 2355   C++
    libcef.dll!blink::Element::setAttribute(const WTF::AtomicString & local_name, const blink::StringOrTrustedHTMLOrTrustedScriptOrTrustedScriptURL & string_or_trusted, blink::ExceptionState & exception_state) Line 2282   C++
    [Inline Frame] libcef.dll!blink::element_v8_internal::SetAttributeMethod(const v8::FunctionCallbackInfo<v8::Value> & info) Line 1673   C++
    libcef.dll!blink::V8Element::SetAttributeMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info) Line 4011   C++
    libcef.dll!v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo handler) Line 159   C++
    libcef.dll!v8::internal::`anonymous namespace'::HandleApiCallHelper<0>(v8::internal::Isolate * isolate, v8::internal::Handle<v8::internal::HeapObject> function, v8::internal::Handle<v8::internal::HeapObject> new_target, v8::internal::Handle<v8::internal::FunctionTemplateInfo> fun_data, v8::internal::Handle<v8::internal::Object> receiver, v8::internal::BuiltinArguments args) Line 113   C++
    libcef.dll!v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments args, v8::internal::Isolate * isolate) Line 141   C++
    libcef.dll!v8::internal::Builtin_HandleApiCall(int args_length, unsigned __int64 * args_object, v8::internal::Isolate * isolate) Line 129   C++
    [External Code]   
    [Inline Frame] libcef.dll!v8::internal::GeneratedCode<unsigned long long,unsigned long long,unsigned long long,unsigned long long,unsigned long long,long long,unsigned long long **>::Call(unsigned __int64 args, unsigned __int64 args, unsigned __int64 args, unsigned __int64 args, __int64 args, unsigned __int64 * * args) Line 142   C++
    libcef.dll!v8::internal::`anonymous namespace'::Invoke(v8::internal::Isolate * isolate, const v8::internal::`anonymous namespace'::InvokeParams & params) Line 367   C++
    libcef.dll!v8::internal::Execution::Call(v8::internal::Isolate * isolate, v8::internal::Handle<v8::internal::Object> callable, v8::internal::Handle<v8::internal::Object> receiver, int argc, v8::internal::Handle<v8::internal::Object> * argv) Line 461   C++
    libcef.dll!v8::Script::Run(v8::Local<v8::Context> context) Line 2089   C++
    libcef.dll!blink::V8ScriptRunner::RunCompiledScript(v8::Isolate * isolate, v8::Local<v8::Script> script, blink::ExecutionContext * context) Line 358   C++
    libcef.dll!blink::ScriptController::ExecuteScriptAndReturnValue(v8::Local<v8::Context> context, const blink::ScriptSourceCode & source, const blink::KURL & base_url, blink::SanitizeScriptErrors sanitize_script_errors, const blink::ScriptFetchOptions & fetch_options) Line 154   C++
    libcef.dll!blink::ScriptController::EvaluateScriptInMainWorld(const blink::ScriptSourceCode & source_code, const blink::KURL & base_url, blink::SanitizeScriptErrors sanitize_script_errors, const blink::ScriptFetchOptions & fetch_options, blink::ScriptController::ExecuteScriptPolicy policy) Line 392   C++
    libcef.dll!blink::ScriptController::ExecuteScriptInMainWorld(const blink::ScriptSourceCode & source_code, const blink::KURL & base_url, blink::SanitizeScriptErrors sanitize_script_errors, const blink::ScriptFetchOptions & fetch_options) Line 357   C++
    libcef.dll!blink::ClassicScript::RunScript(blink::LocalFrame * frame, const blink::SecurityOrigin * security_origin) Line 26   C++
    libcef.dll!blink::PendingScript::ExecuteScriptBlockInternal(blink::Script * script, blink::ScriptElementBase * element, bool was_canceled, bool is_external, bool created_during_document_write, base::TimeTicks parser_blocking_load_start_time, bool is_controlled_by_script_runner) Line 269   C++
    libcef.dll!blink::PendingScript::ExecuteScriptBlock(const blink::KURL & document_url) Line 170   C++
    libcef.dll!blink::`anonymous namespace'::DoExecuteScript(blink::PendingScript * pending_script, const blink::KURL & document_url) Line 88   C++
    libcef.dll!blink::HTMLParserScriptRunner::ExecutePendingParserBlockingScriptAndDispatchEvent() Line 231   C++
    libcef.dll!blink::HTMLParserScriptRunner::ExecuteParsingBlockingScripts() Line 406   C++
    libcef.dll!blink::HTMLParserScriptRunner::ProcessScriptElement(blink::Element * script_element, const WTF::TextPosition & script_start_position) Line 367   C++
    libcef.dll!blink::HTMLDocumentParser::RunScriptsForPausedTreeBuilder() Line 492   C++
    libcef.dll!blink::HTMLDocumentParser::ProcessTokenizedChunkFromBackgroundParser(std::__1::unique_ptr<blink::HTMLDocumentParser::TokenizedChunk,std::__1::default_delete<blink::HTMLDocumentParser::TokenizedChunk>> pop_chunk, bool * reached_end_of_file) Line 733   C++
    libcef.dll!blink::HTMLDocumentParser::PumpPendingSpeculations() Line 794   C++
    libcef.dll!blink::HTMLDocumentParser::ResumeParsingAfterPause() Line 1342   C++
    libcef.dll!blink::HTMLDocumentParser::ExecuteScriptsWaitingForResources() Line 1395   C++
    [Inline Frame] libcef.dll!base::OnceCallback<void ()>::Run() Line 99   C++
    [Inline Frame] libcef.dll!WTF::ThreadCheckingCallbackWrapper<base::OnceCallback<void ()>,void ()>::RunInternal(base::OnceCallback<void ()> * callback) Line 263   C++
    libcef.dll!WTF::ThreadCheckingCallbackWrapper<base::OnceCallback<void ()>,void ()>::Run() Line 248   C++
    [Inline Frame] libcef.dll!base::OnceCallback<void ()>::Run() Line 99   C++
    libcef.dll!blink::TaskHandle::Runner::Run(const blink::TaskHandle &) Line 47   C++
    [Inline Frame] libcef.dll!base::OnceCallback<void ()>::Run() Line 99   C++
    [Inline Frame] libcef.dll!WTF::ThreadCheckingCallbackWrapper<base::OnceCallback<void ()>,void ()>::RunInternal(base::OnceCallback<void ()> * callback) Line 263   C++
    libcef.dll!WTF::ThreadCheckingCallbackWrapper<base::OnceCallback<void ()>,void ()>::Run() Line 248   C++
    [Inline Frame] libcef.dll!base::OnceCallback<void ()>::Run() Line 99   C++
    libcef.dll!base::TaskAnnotator::RunTask(const char * trace_event_name, base::PendingTask * pending_task) Line 142   C++
    libcef.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow * continuation_lazy_now) Line 334   C++
    libcef.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() Line 255   C++
    libcef.dll!base::MessagePumpDefault::Run(base::MessagePump::Delegate * delegate) Line 41   C++
    libcef.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool application_tasks_allowed, base::TimeDelta timeout) Line 456   C++
    libcef.dll!base::RunLoop::Run() Line 126   C++
    libcef.dll!content::RendererMain(const content::MainFunctionParams & parameters) Line 231   C++
    libcef.dll!content::ContentMainRunnerImpl::Run(bool start_service_manager_only) Line 883   C++
    libcef.dll!service_manager::MainRun(service_manager::MainParams & params) Line 460   C++
    libcef.dll!service_manager::Main(service_manager::MainParams & params) Line 507   C++
    libcef.dll!content::ContentMain(const content::ContentMainParams & params) Line 19   C++
    libcef.dll!CefMainRunner::RunAsHelperProcess(const CefMainArgs & args, scoped_refptr<CefApp> application, void * windows_sandbox_info) Line 352   C++
    libcef.dll!CefExecuteProcess(const CefMainArgs & args, scoped_refptr<CefApp> application, void * windows_sandbox_info) Line 185   C++
    libcef.dll!cef_execute_process(const _cef_main_args_t * args, _cef_app_t * application, void * windows_sandbox_info) Line 78   C++
    cef_process.debug.x64.exe!CefExecuteProcess(const CefMainArgs & args, scoped_refptr<CefApp> application, void * windows_sandbox_info) Line 81   C++
    cef_process.debug.x64.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * __formal, wchar_t * lpCmdLine, int __formal) Line 29   C++
    [External Code]   

Hemmy
Newbie
 
Posts: 6
Joined: Mon Oct 19, 2020 4:43 am

Re: TS_PROCESS_CRASHED crashing render thread

Postby magreenblatt » Tue Oct 20, 2020 12:50 pm

Are you configuring any CefSettings or CefBrowserSettings? What locale is your OS? Does the crash reproduce with the CEF sample applications?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: TS_PROCESS_CRASHED crashing render thread

Postby Hemmy » Wed Oct 21, 2020 4:17 am

These are my current settings for the browser

Code: Select all
CefWindowInfo info;
info.SetAsWindowless(nullptr);     
CefBrowserSettings browserSettings;
browserSettings.background_color = 0xffffffff;
CefBrowserHost::CreateBrowser(info, m_cefHandler, url, browserSettings, nullptr,nullptr);


and settings for CefInitialize

Code: Select all
CefMainArgs args(GetModuleHandle(nullptr));
CefSettings settings;
settings.no_sandbox                                 = true;
settings.windowless_rendering_enabled    = true;
settings.remote_debugging_port               = 8088;
settings.multi_threaded_message_loop     = true;
settings.external_message_pump              = false;
settings.uncaught_exception_stack_size    = 10;
   
cef_string_set(params.log_file_name.c_str(),        params.log_file_name.length(),      &settings.log_file, 1);
cef_string_set(params.cef_process_name.c_str(),     params.cef_process_name.length(),   &settings.browser_subprocess_path, 1);
cef_string_set(params.cef_resources_dir.c_str(),    params.cef_resources_dir.length(),  &settings.resources_dir_path, 1);
cef_string_set(params.cef_locales_dir.c_str(),      params.cef_locales_dir.length(),    &settings.locales_dir_path, 1);

CefInitialize(args, settings, mClient, nullptr);

I don't have any commandline switches apart from "renderer-startup-dialog" to attach to the process. I've also just noticed that when the process throws the exception, the value of error_code is "U_MISSING_RESOURCE_ERROR". The resource path is definitely pointing to the correct place. I've confirmed this by trying to rename some of the files whilst the browser is running and they appear to be in use.

My OS locale is English(United States). Unfortunately I cannot reproduce this on any of the sample applications which is why I've been stuck on this bug for a good while now.
Hemmy
Newbie
 
Posts: 6
Joined: Mon Oct 19, 2020 4:43 am

Re: TS_PROCESS_CRASHED crashing render thread

Postby ndesktop » Wed Oct 21, 2020 7:19 am

Try to comment one or more of these lines:
Code: Select all
cef_string_set(params.cef_process_name.c_str(),     params.cef_process_name.length(),   &settings.browser_subprocess_path, 1);
cef_string_set(params.cef_resources_dir.c_str(),    params.cef_resources_dir.length(),  &settings.resources_dir_path, 1);
cef_string_set(params.cef_locales_dir.c_str(),      params.cef_locales_dir.length(),    &settings.locales_dir_path, 1);


For debugging, --single-process still works in most of the cases.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: TS_PROCESS_CRASHED crashing render thread

Postby Hemmy » Thu Oct 22, 2020 3:46 am

These lines set the corresponding paths so cef has access to them. Commenting them out has the expected result of crashing cef
Hemmy
Newbie
 
Posts: 6
Joined: Mon Oct 19, 2020 4:43 am

Re: TS_PROCESS_CRASHED crashing render thread

Postby Hemmy » Wed Feb 03, 2021 6:25 am

Apologies for the super delayed post! I found the issue in the end. A version icudtl.dat already existed in my outputs folder which conflicted with the one supplied by CEF. Changing it to the updated version fixes the problem :)
Hemmy
Newbie
 
Posts: 6
Joined: Mon Oct 19, 2020 4:43 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 112 guests