Created attachment 394302 [details] Stack trace on (iPhone9,3 13.3.1 17D50) Starting in iOS 13 and still occurring in iOS 13.4, an assertion in `_WebThreadLock` is being hit: `Multiple locks on web thread not allowed! Please file a bug. Crashing now...`. The attached stack trace points to the following `WebCore` code: ``` __ZL14_WebThreadLockv.cold.1: // _WebThreadLock() [clone .cold.1] 0000000189ab5708 sub sp, sp, #0x20 ; CODE XREF=__ZL14_WebThreadLockv+336 0000000189ab570c stp x29, x30, [sp, #0x10] 0000000189ab5710 add x29, sp, #0x10 0000000189ab5714 bl __ZL20CurrentThreadContextv ; CurrentThreadContext() 0000000189ab5718 adrp x8, #0x189b51000 ; 0x189b51340@PAGE 0000000189ab571c add x8, x8, #0x340 ; 0x189b51340@PAGEOFF, "void _WebThreadLock()" 0000000189ab5720 stp x8, x0, [sp] 0000000189ab5724 adrp x0, #0x1bf154000 ; 0x1bf154850@PAGE 0000000189ab5728 add x0, x0, #0x850 ; 0x1bf154850@PAGEOFF, @"%s, %p: Multiple locks on web thread not allowed! Please file a bug. Crashing now..." 0000000189ab572c bl imp___stubs___ZNK2sh14TConstantUniongtERKS0_ ; sh::TConstantUnion::operator>(sh::TConstantUnion const&) const 0000000189ab5730 brk #0x0 0000000189ab5734 brk #0x1 ``` We do not have information about what was happening in the app prior to the crash aside from the attached stack trace.
Would you be able to characterize customer impact, and whether this app can move to modern WebKit API?
<rdar://problem/60858737>
(In reply to Alexey Proskuryakov from comment #1) > Would you be able to characterize customer impact, and whether this app can > move to modern WebKit API? We’ve been seeing this crash for years. ~340k crash reports since 2016. We are using iOS’s `UIWebView`. By “modern WebKit API”, do you mean `WKWebView`?
> We are using iOS’s `UIWebView`. By “modern WebKit API”, do you mean `WKWebView`? Correct.
(In reply to Alexey Proskuryakov from comment #4) > > We are using iOS’s `UIWebView`. By “modern WebKit API”, do you mean `WKWebView`? > > Correct. We are in the process of migrating now. To be clear, this crash will not occur when using `WKWebView`, right? Is this a known issue with `UIWebView`?
WebThread isn't used with WKWebView (it uses a separate process for web content), so this issue definitely won't happen. I don't know if it's necessarily a legacy WebKit bug - searching the Web for "Multiple locks on web thread not allowed", I see many hits explaining programming model violations in client code that can lead to this. But legacy WebKit certainly has architectural threading issues of its own too.
Great, thanks! I will mark this bug as resolved then.