WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
167776
REGRESSION(
r211486
) [GTK] The MiniBrowser doesn't work anymore.
https://bugs.webkit.org/show_bug.cgi?id=167776
Summary
REGRESSION(r211486) [GTK] The MiniBrowser doesn't work anymore.
Carlos Alberto Lopez Perez
Reported
2017-02-02 21:51:15 PST
After
r211486
trying to open the WebKitGTK+ mini-browser timeouts/hangs. Build WebKitGTK+ at 211616 1. $ Tools/Scripts/run-minibrowser --gtk
https://www.google.com
... timeout .. nothing renders in the webview inside the minibrowser 2. Revert
r211486
(only the changes on Source/JavaScriptCore/runtime/InitializeThreading.cpp) 3. Rebuild 4. $ Tools/Scripts/run-minibrowser --gtk
https://www.google.com
.. now it works.
Attachments
Patch
(2.00 KB, patch)
2017-02-02 23:49 PST
,
Carlos Garcia Campos
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Carlos Garcia Campos
Comment 1
2017-02-02 23:10:08 PST
I haven't debugged it yet, but looking at the patch I think the problem is that the glib RunLoop implementation requires that WTF::initializeMainThread() is called before RunLoop::initializeMainRunLoop() This is because we need to know if we are the main thread run loop (and we can't compare to s_mainRunLoop because we are in the constructor. So, if we move the main loop initialization to JSC::initializeThreading() we should also do the initializeMainThread and remove those from InitializeWebKit2 and any other callers of JSC::initializeThreading() that also initialize main thread and main run loop
Carlos Garcia Campos
Comment 2
2017-02-02 23:43:16 PST
In some places we do: JSC::initializeThreading(); WTF::initializeMainThread(); in others: JSC::initializeThreading(); WTF::initializeMainThread(); RunLoop::initializeMainRunLoop(); and in others even: WTF::initializeMainThread(); JSC::initializeThreading(); In iOS the web thread does this: // WTF::initializeMainThread() needs to be called before JSC::initializeThreading() since the // code invoked by the latter needs to know if it's running on the WebThread. See // <
rdar://problem/8502487
>. WTF::initializeMainThread(); WTF::initializeWebThread(); JSC::initializeThreading(); So, a quick solution to this bug could be doing this in InitializeWebKit2 WTF::initializeThreading(); WTF::initializeMainThread(); JSC::initializeThreading(); But I think we should check all the callers of all initializeThreading methods to make it consistent.
Carlos Garcia Campos
Comment 3
2017-02-02 23:49:33 PST
Created
attachment 300506
[details]
Patch
Carlos Garcia Campos
Comment 4
2017-02-03 02:45:07 PST
***
Bug 167735
has been marked as a duplicate of this bug. ***
Yusuke Suzuki
Comment 5
2017-02-03 04:04:12 PST
Comment on
attachment 300506
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=300506&action=review
r=me with the future refactoring proposal.
> Source/WebKit2/Shared/WebKit2Initialize.cpp:56 > + JSC::initializeThreading();
It's strange to me that we need to care these ordering. Why not calling RunLoop::initializeMainRunLoop() in WTF::initializeMainThread? And why not calling WTF::initializeThreading and WTF::initializeMainThread in JSC::initializeThreading? By using std::call_once, we can avoid the case that these functions are called more than once. And after such a refactoring, I think just calling JSC::initializeThreading() here is OK.
Carlos Garcia Campos
Comment 6
2017-02-03 04:14:47 PST
(In reply to
comment #5
)
> Comment on
attachment 300506
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=300506&action=review
> > r=me with the future refactoring proposal. > > > Source/WebKit2/Shared/WebKit2Initialize.cpp:56 > > + JSC::initializeThreading(); > > It's strange to me that we need to care these ordering. > Why not calling RunLoop::initializeMainRunLoop() in > WTF::initializeMainThread?
That was my plan, but then I need to check all the callers, and this is serious, so better fix it soon.
> And why not calling WTF::initializeThreading and WTF::initializeMainThread > in JSC::initializeThreading? > By using std::call_once, we can avoid the case that these functions are > called more than once. > And after such a refactoring, I think just calling > JSC::initializeThreading() here is OK.
Yes, there are many things quite fragile in all threading initializations. I'm going to review all of them and all the callers and try a new simpler approach.
WebKit Commit Bot
Comment 7
2017-02-03 04:41:54 PST
Comment on
attachment 300506
[details]
Patch Clearing flags on attachment: 300506 Committed
r211629
: <
http://trac.webkit.org/changeset/211629
>
WebKit Commit Bot
Comment 8
2017-02-03 04:41:59 PST
All reviewed patches have been landed. Closing bug.
Joseph Pecoraro
Comment 9
2017-02-03 21:01:02 PST
> > And why not calling WTF::initializeThreading and WTF::initializeMainThread > > in JSC::initializeThreading? > > By using std::call_once, we can avoid the case that these functions are > > called more than once. > > And after such a refactoring, I think just calling > > JSC::initializeThreading() here is OK. > > Yes, there are many things quite fragile in all threading initializations. > I'm going to review all of them and all the callers and try a new simpler > approach.
Yeah, we are now running into an issue on that iOS WebThread initialization path. Due to the order here we may end up doing RunLoop initialization on the WebThread instead of the main thread! I think my original change is incorrect. I will rework it but ensure that we get the expected order of initialization here. Follow on
bug 167828
.
Joseph Pecoraro
Comment 10
2017-02-03 21:21:00 PST
I rolled the original change out (and this follow-up since it depended on it) in:
https://trac.webkit.org/changeset/211666
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug