Bug 225481 - [iOS] Safari sometimes hangs underneath `WebKit::UIDelegate::UIClient::createNewPage`
Summary: [iOS] Safari sometimes hangs underneath `WebKit::UIDelegate::UIClient::create...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-06 14:16 PDT by Wenson Hsieh
Modified: 2021-05-07 05:05 PDT (History)
6 users (show)

See Also:


Attachments
Patch (8.27 KB, patch)
2021-05-06 14:41 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
For EWS (12.46 KB, patch)
2021-05-06 17:44 PDT, Wenson Hsieh
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Fix non-internal builds (12.45 KB, patch)
2021-05-06 17:52 PDT, Wenson Hsieh
cdumez: review+
Details | Formatted Diff | Diff
Use %{public}s (12.45 KB, patch)
2021-05-06 19:26 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2021-05-06 14:16:09 PDT
rdar://77565282
Comment 1 Wenson Hsieh 2021-05-06 14:41:11 PDT
Created attachment 427937 [details]
Patch
Comment 2 Chris Dumez 2021-05-06 17:00:03 PDT
Comment on attachment 427937 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=427937&action=review

> Source/WebKit/Platform/IPC/Connection.cpp:573
>  

The patch doesn't seem to apply to tip of tree. Could you please make sure we have an ASSERT(isMainRunLoop()) in Connection::waitForMessage() and Connection::dispatchSyncMessage() since we're using m_inDispatchSyncMessageCount in both?

> Source/WebKit/Platform/IPC/Connection.cpp:940
> +    m_inDispatchSyncMessageCount++;

Would use prefixed version: ++m_inDispatchSyncMessageCount;

> Source/WebKit/Platform/IPC/Connection.cpp:942
> +        m_inDispatchSyncMessageCount--;

Would use prefixed version and add an assertion for extra safety:
ASSERT(m_inDispatchSyncMessageCount);
--m_inDispatchSyncMessageCount;

> Source/WebKit/Platform/IPC/Timeout.h:41
> +    constexpr bool isInfinity() const { return !m_deadline; }

Isn't m_deadline MonotonicTime::infinity() when we're infinity?
Comment 3 Chris Dumez 2021-05-06 17:04:58 PDT
Comment on attachment 427937 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=427937&action=review

>> Source/WebKit/Platform/IPC/Timeout.h:41
>> +    constexpr bool isInfinity() const { return !m_deadline; }
> 
> Isn't m_deadline MonotonicTime::infinity() when we're infinity?

I *think* this should be `std::isnan(m_deadline)`
Comment 4 Chris Dumez 2021-05-06 17:05:40 PDT
(In reply to Chris Dumez from comment #3)
> Comment on attachment 427937 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=427937&action=review
> 
> >> Source/WebKit/Platform/IPC/Timeout.h:41
> >> +    constexpr bool isInfinity() const { return !m_deadline; }
> > 
> > Isn't m_deadline MonotonicTime::infinity() when we're infinity?
> 
> I *think* this should be `std::isnan(m_deadline)`

I meant std::isinf().
Comment 5 Wenson Hsieh 2021-05-06 17:17:14 PDT
Comment on attachment 427937 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=427937&action=review

>> Source/WebKit/Platform/IPC/Connection.cpp:573
>>  
> 
> The patch doesn't seem to apply to tip of tree. Could you please make sure we have an ASSERT(isMainRunLoop()) in Connection::waitForMessage() and Connection::dispatchSyncMessage() since we're using m_inDispatchSyncMessageCount in both?

That's odd — it seemed to apply when I just pulled. Will add the assertions!

>> Source/WebKit/Platform/IPC/Connection.cpp:940
>> +    m_inDispatchSyncMessageCount++;
> 
> Would use prefixed version: ++m_inDispatchSyncMessageCount;

👍🏻

>> Source/WebKit/Platform/IPC/Connection.cpp:942
>> +        m_inDispatchSyncMessageCount--;
> 
> Would use prefixed version and add an assertion for extra safety:
> ASSERT(m_inDispatchSyncMessageCount);
> --m_inDispatchSyncMessageCount;

Good call!

>>>> Source/WebKit/Platform/IPC/Timeout.h:41
>>>> +    constexpr bool isInfinity() const { return !m_deadline; }
>>> 
>>> Isn't m_deadline MonotonicTime::infinity() when we're infinity?
>> 
>> I *think* this should be `std::isnan(m_deadline)`
> 
> I meant std::isinf().

Good catch — changing this to `std::isinf(m_deadline)`.

I didn't see the private constructor below, and thought that it initialized m_deadline to the default MonotonicTime :(
Comment 6 Wenson Hsieh 2021-05-06 17:28:46 PDT
For some reason, it looks like Timeout.h isn't in the Xcode project either. I'll go ahead and add it there while I'm making changes...
Comment 7 Wenson Hsieh 2021-05-06 17:44:26 PDT
Created attachment 427966 [details]
For EWS
Comment 8 Wenson Hsieh 2021-05-06 17:52:41 PDT
Created attachment 427968 [details]
Fix non-internal builds
Comment 9 Chris Dumez 2021-05-06 18:21:57 PDT
Comment on attachment 427968 [details]
Fix non-internal builds

View in context: https://bugs.webkit.org/attachment.cgi?id=427968&action=review

> Source/WebKit/Platform/IPC/Connection.cpp:575
> +            RELEASE_LOG_ERROR(IPC, "Connection::waitForMessage(%s): Exiting immediately, since we're handling a sync message already", description(messageName));

%{public}s
Comment 10 Wenson Hsieh 2021-05-06 19:26:27 PDT
Created attachment 427971 [details]
Use %{public}s
Comment 11 EWS 2021-05-07 05:05:50 PDT
Committed r277169 (237455@main): <https://commits.webkit.org/237455@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 427971 [details].