Crash with QtWebEngine on macOS (Hardened Runtime)

60 views
Skip to first unread message

Dmitry Kravchenko

unread,
Sep 19, 2019, 1:03:52 AM9/19/19
to v8-dev
Hi!

I'm developing an application with Qt 5.9.3 on macOS. My application uses QtWebEngine framework to display Web pages. QtWebEngine in turn uses Chromium/Blink code for rendering. It all worked successfully until recently Apple demanded all apps on macOS 10.15 to be notarized. Notarization involves enabling hardened runtime. After I enabled hardened runtime, QtWebEngine stopped working: nothing is rendered and in the background QtWebEngineProcess crashes repeatedly.

Why I'm asking for help here is because judging by call stack QtWebEngineProcess crashes inside Chromium code (specifically, Blink -> V8):

Thread 0 Crashed:: CrRendererMain  Dispatch queue: com.apple.main-thread
0   org.qt-project.Qt.QtWebEngineCore	0x000000010c32fdbe v8::internal::Deoptimizer::GetDeoptimizationEntry(v8::internal::Isolate*, int, v8::internal::Deoptimizer::BailoutType, v8::internal::Deoptimizer::GetEntryMode) + 94
1   org.qt-project.Qt.QtWebEngineCore	0x000000010c3703e1 v8::internal::ExternalReferenceTable::AddDeoptEntries(v8::internal::Isolate*) + 97
2   org.qt-project.Qt.QtWebEngineCore	0x000000010c36bc02 v8::internal::ExternalReferenceTable::ExternalReferenceTable(v8::internal::Isolate*) + 210
3   org.qt-project.Qt.QtWebEngineCore	0x000000010c36bb0e v8::internal::ExternalReferenceTable::instance(v8::internal::Isolate*) + 46
4   org.qt-project.Qt.QtWebEngineCore	0x000000010c6d72d9 v8::internal::Deserializer::Deserialize(v8::internal::Isolate*) + 25
5   org.qt-project.Qt.QtWebEngineCore	0x000000010c478d46 v8::internal::Isolate::Init(v8::internal::Deserializer*) + 9878
6   org.qt-project.Qt.QtWebEngineCore	0x000000010c6dfb53 v8::internal::Snapshot::Initialize(v8::internal::Isolate*) + 723
7   org.qt-project.Qt.QtWebEngineCore	0x000000010bfbdf09 v8::Isolate::New(v8::Isolate::CreateParams const&) + 361
8   org.qt-project.Qt.QtWebEngineCore	0x000000010bf8750c gin::IsolateHolder::IsolateHolder(gin::IsolateHolder::AccessMode) + 284
9   org.qt-project.Qt.QtWebEngineCore	0x000000010d2e9cbf blink::V8PerIsolateData::V8PerIsolateData() + 31
10  org.qt-project.Qt.QtWebEngineCore	0x000000010d2ea382 blink::V8PerIsolateData::initialize() + 34
11  org.qt-project.Qt.QtWebEngineCore	0x000000010d2e38cb blink::V8Initializer::initializeMainThread() + 107
12  org.qt-project.Qt.QtWebEngineCore	0x000000010d267ac4 blink::initialize(blink::Platform*) + 20
13  org.qt-project.Qt.QtWebEngineCore	0x000000010cedc97e content::RenderThreadImpl::InitializeWebKit(scoped_refptr<base::SingleThreadTaskRunner>&) + 174
14  org.qt-project.Qt.QtWebEngineCore	0x000000010cedaecc content::RenderThreadImpl::Init(scoped_refptr<base::SingleThreadTaskRunner>&) + 300
15  org.qt-project.Qt.QtWebEngineCore	0x000000010ceda65a content::RenderThreadImpl::RenderThreadImpl(std::__1::unique_ptr<base::MessageLoop, std::__1::default_delete<base::MessageLoop> >, std::__1::unique_ptr<blink::scheduler::RendererScheduler, std::__1::default_delete<blink::scheduler::RendererScheduler> >) + 1434
16  org.qt-project.Qt.QtWebEngineCore	0x000000010ceda07c content::RenderThreadImpl::Create(std::__1::unique_ptr<base::MessageLoop, std::__1::default_delete<base::MessageLoop> >, std::__1::unique_ptr<blink::scheduler::RendererScheduler, std::__1::default_delete<blink::scheduler::RendererScheduler> >) + 76
17  org.qt-project.Qt.QtWebEngineCore	0x000000010cf0b165 content::RendererMain(content::MainFunctionParams const&) + 517
18  org.qt-project.Qt.QtWebEngineCore	0x000000010aa395b5 content::ContentMainRunnerImpl::Run() + 437
19  org.qt-project.Qt.QtWebEngineCore	0x000000010aa38976 content::ContentMain(content::ContentMainParams const&) + 54
20  org.qt-project.Qt.QtWebEngineCore	0x0000000109ee2e36 QtWebEngine::processMain(int, char const**) + 70
21  org.qt-project.Qt.QtWebEngineProcess	0x0000000109e99f54 0x109e95000 + 20308
22  libdyld.dylib                 	0x00007fff7e1433d5 start + 1

Can you please help me to find out exactly why Blink / V8 is crashing here? That would help me to workaround this.

I already asked on Qt forum, with no reply, and by the way, here's another developer experiencing similar issue with QtWebEngine: https://forum.qt.io/topic/102212/qtwebengine-signing-issues .
I tried what he suggests: adding entitlement to QtWebEngineProcess, with no success. I'm attaching a full crash report from QtWebEngineProcess with that entitlement enabled.

Thanks in advance!
QtWebEngineProcess_2019-09-16-173313-3_Dmitriys-Mac-mini.crash

Jakob Gruber

unread,
Sep 19, 2019, 2:23:39 AM9/19/19
to v8-...@googlegroups.com
Just a guess, since you mention notarization and the crash is in GetDeoptimizationEntry (deopt entries are generated at runtime): did you declare Allow Execution of JIT-compiled Code Entitlement?

If that doesn't help, it'd be great to find out more about the crash. Which part of GetDeoptimizationEntry crashes and how?

--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/baa4a934-669f-428d-8f72-85dd235d0dc6%40googlegroups.com.

Dmitry Kravchenko

unread,
Sep 19, 2019, 4:36:01 AM9/19/19
to v8-dev
I tried adding all possible entitlements from here: https://developer.apple.com/documentation/bundleresources/entitlements , including com.apple.security.cs.allow-jit (with no success).

I attached a full crash report with call stacks and reason of the crash. I myself would like know why and where exactly it crashes.
I don't know how I can debug QtWebEngineProcess: it is launched silently in the background by QtWebEngine and crashes shortly after startup.


четверг, 19 сентября 2019 г., 13:23:39 UTC+7 пользователь Jakob Gruber написал:
To unsubscribe from this group and stop receiving emails from it, send an email to v8-...@googlegroups.com.

Dan Elphick

unread,
Sep 19, 2019, 6:27:05 AM9/19/19
to v8-dev
I'm not sure what version of V8 QTWebEngine is using but the stack trace contains ExternalReferenceTable::AddDeoptEntries, which was removed 2.5 years ago. It's going to be difficult for anyone here to help you debug this issue on such an old version. Can you upgrade to a new version of Qt and try again?

kindm...@gmail.com

unread,
Sep 20, 2019, 3:34:23 AM9/20/19
to v8-dev
QtWebEngine 5.9.3 uses this version of V8: 2016-11-15: Version 5.6.326.55

Unfortunately, it's not possible at this time for me to upgrade to a Qt version higher than 5.9.

четверг, 19 сентября 2019 г., 17:27:05 UTC+7 пользователь Dan Elphick написал:
Reply all
Reply to author
Forward
0 new messages