Bug 251092

Summary: Webview crashes (sometimes) when modals (windows) are loading in the background
Product: WebKit Reporter: PaulPlay <lollollipop878>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Major CC: ap, cdumez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: iPhone / iPad   
OS: iOS 16   

PaulPlay
Reported 2023-01-24 09:14:30 PST
I am using cordova with the Construct 3 game engine and when switching to a different window which is preloaded I experience this webkit-realted bug. Xcode debug console error: 2023-01-24 17:15:35.778534+0100 Bluelife[25718:8527896] [ServicesDaemonManager] interruptionHandler is called. -[FontServicesDaemonManager connection]_block_invoke 2023-01-24 17:17:16.160571+0100 Bluelife[25718:8529054] [XPC] Handle connection with error: Connection interrupted 2023-01-24 17:19:07.020278+0100 Bluelife[25718:8522619] [Process] 0x10d003c60 - [PID=25721] WebProcessProxy::didClose: (web process 25721 crash) 2023-01-24 17:19:07.021206+0100 Bluelife[25718:8522619] [Process] 0x10d003c60 - [PID=25721] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash 2023-01-24 17:19:07.021411+0100 Bluelife[25718:8522619] [ProcessSuspension] 0x10c01c120 - ProcessAssertion: Failed to acquire RBS Background assertion 'ConnectionTerminationWatchdog' for process because PID 0 is invalid 2023-01-24 17:19:07.022371+0100 Bluelife[25718:8522619] [Process] 0x13a039218 - [pageProxyID=14, webPageID=15, PID=25721] WebPageProxy::processDidTerminate: (pid 25721), reason=Crash 2023-01-24 17:19:07.022481+0100 Bluelife[25718:8530140] [ProcessSuspension] 0x10c01c120 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=0, error: (null) 2023-01-24 17:19:07.042997+0100 Bluelife[25718:8530140] [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}> 2023-01-24 17:19:07.043389+0100 Bluelife[25718:8530140] [ProcessSuspension] 0x10c01c180 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess Background Assertion' for process with PID=25721, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit} 2023-01-24 17:19:07.085655+0100 Bluelife[25718:8522619] [Loading] 0x13a039218 - [pageProxyID=14, webPageID=15, PID=25721] WebPageProxy::dispatchProcessDidTerminate: reason=Crash 2023-01-24 17:19:07.162310+0100 Bluelife[25718:8522619] [Process] 0x10c0744e0 - GPUProcessProxy::gpuProcessExited: reason=IdleExit 2023-01-24 17:19:07.162426+0100 Bluelife[25718:8522619] [Process] 0x10d001510 - [PID=0] WebProcessProxy::gpuProcessExited: reason=IdleExit 2023-01-24 17:19:07.165540+0100 Bluelife[25718:8522619] [Sandbox] Could not enable Mach bootstrap, errno = 1. 2023-01-24 17:19:07.165725+0100 Bluelife[25718:8522619] [Sandbox] Could not enable Mach bootstrap, errno = 1. 2023-01-24 17:19:07.719692+0100 Bluelife[25718:8522619] IAB.close() called but it was already closed. Device crashlog: Date/Time: 2023-01-24 17:05:47.942 +0100 End time: 2023-01-24 17:10:19.709 +0100 OS Version: iPhone OS 16.2 (Build 20C65) Architecture: arm64e Report Version: 40 Incident Identifier: 809899E9-41F5-4260-9C3A-F43C4389CB35 Data Source: Microstackshots Shared Cache: D962ECAE-C2C7-30CA-A3A4-779B8ECD896A slid base address 0x185d9c000, slide 0x5d9c000 Shared Cache: E3B4ED03-39A9-349E-B41F-0C9156CC6150 slid base address 0x1dc27c000, slide 0x5c27c000 Command: com.apple.WebKit.Networking Path: /private/preboot/Cryptexes/OS/System/Library/Frameworks/WebKit.framework/XPCServices/com.apple.WebKit.Networking.xpc/com.apple.WebKit.Networking Identifier: com.apple.WebKit.Networking Version: 8614 (8614.3.7.0.6) Resource Coalition ID: 2367 Architecture: arm64 PID: 25722 Event: wakeups Action taken: none Wakeups: 45001 wakeups over the last 272 seconds (166 wakeups per second average), exceeding limit of 150 wakeups per second over 300 seconds Wakeups limit: 45000 Limit duration: 300s Wakeups caused: 45001 Wakeups duration: 272s Duration: 271.77s Duration Sampled: 265.75s Steps: 135 Hardware model: iPhone12,3 Active cpus: 6 HW page size: 16384 VM page size: 16384 OS Cryptex File Extents: 3756 Heaviest stack for the target process: 2 ??? (libsystem_pthread.dylib + 2968) [0x1dac1db98] 2 ??? (libsystem_pthread.dylib + 3576) [0x1dac1ddf8] 2 ??? (libdispatch.dylib + 93712) [0x1941bbe10] 1 ??? (libdispatch.dylib + 49376) [0x1941b10e0] Powerstats for: com.apple.WebKit.Networking [25722] [unique pid 225368] UUID: 1FD526B8-4C03-36F3-A4D5-46B7C61B6B9D Path: /private/preboot/Cryptexes/OS/System/Library/Frameworks/WebKit.framework/XPCServices/com.apple.WebKit.Networking.xpc/com.apple.WebKit.Networking Identifier: com.apple.WebKit.Networking Version: 8614 (8614.3.7.0.6) Shared Cache: D962ECAE-C2C7-30CA-A3A4-779B8ECD896A slid base address 0x185d9c000, slide 0x5d9c000 Resource Coalition ID: 2367 Architecture: arm64 Footprint: 4272 KB -> 5248 KB (+976 KB) Pageins: 63 pages Start time: 2023-01-24 17:06:04.165 +0100 End time: 2023-01-24 17:10:13.894 +0100 Num samples: 6 (4%) Primary state: 2 samples Frontmost App, Non-Suppressed, User mode, Effective Thread QoS User Initiated, Requested Thread QoS User Initiated, Override Thread QoS Unspecified User Activity: 0 samples Idle, 6 samples Active Power Source: 0 samples on Battery, 6 samples on AC
Attachments
Alexey Proskuryakov
Comment 1 2023-01-24 18:52:41 PST
This is not a crash, just a logging for significant work being done in the background. Not entirely sure what the purpose of that is, but probably no reason to be concerned.
PaulPlay
Comment 2 2023-01-24 22:31:36 PST
Interesting. However, the app then goes black and reloads the entire webview. I monitored ram / cpu / gpu usage in xcode and also looked for memory leaks but found nothing that could have caused this. A few other cordova users experience this issue (https://github.com/apache/cordova-ios/issues/1103). It could be connected to this issue: https://github.com/ionic-team/ionic-framework/issues/25760.
PaulPlay
Comment 3 2023-01-24 22:34:24 PST
This might also be the same webview problem: https://developer.apple.com/forums/thread/709919
Alexey Proskuryakov
Comment 4 2023-01-25 07:53:33 PST
> However, the app then goes black and reloads the entire webview. Fair enough. Can you provide detailed steps to reproduce please? Generally, we wouldn't be able to follow sets that include making our own test project.
PaulPlay
Comment 5 2023-01-25 21:32:45 PST
Alright, I‘ll try to create an xcode project where I can reproduce the bug. Unfortunately, it‘s only crashing around 5% of the time, that makes it hard to check whether a change really led to the crash.
Radar WebKit Bug Importer
Comment 6 2023-01-31 09:15:19 PST
PaulPlay
Comment 7 2023-01-31 10:47:14 PST
So I‘ve tried a lot to replicate this bug, but it does not occur in the simulator wich makes it extremely tough to test. It happened in places where it had never happened once, often with a very low probability. I only know that it is connected to switching windows and loading images into memory, but really that is it. The size of the images doesn’t matter that much, but you need a big amount of them (>100). I was able to replicate it once (out of ~80 tries) in a test project but it didn’t occur a single time in it since. In my main project however, which is a lot bigger in scale, it happens more often (still rather rare).
Note You need to log in before you can comment on or make changes to this bug.