Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random crash (iOS 13/14/15/16) #5970

Closed
chris087 opened this issue Oct 4, 2022 · 5 comments
Closed

Random crash (iOS 13/14/15/16) #5970

chris087 opened this issue Oct 4, 2022 · 5 comments

Comments

@chris087
Copy link

chris087 commented Oct 4, 2022

When taking a photo and click "Select photo". It randomly crash, (white screen and app restarts.)
It happen more often when some background apps are running.

My code:
` public async takePhoto() {

return new Promise<any>((resolve, reject) => {

      // Take a photo
       Camera.getPhoto({
        resultType: CameraResultType.Uri,
        source: CameraSource.Camera,
        quality: 80,
        width: 1024,
        saveToGallery: false
      }).then((res: any) => {
    
        let img = this.savePicture(res);
        console.log("Photo taken");
        console.log(img);

        resolve(img);

      })
      .catch(error => {
         console.log("Photo not taken");
         reject(error);
      });

    
});

}

private savePicture(photo: Photo) {
return {
webviewPath: photo.webPath,
data: '',
cssClass: '',
};
}`

Error log:

2022-10-04 09:39:49.597416+0200 App[61959:2477260] [XPC] Handle connection with error: Connection interrupted
2022-10-04 09:39:49.640079+0200 App[61959:2477259] [ServicesDaemonManager] interruptionHandler is called. -[FontServicesDaemonManager connection]_block_invoke
2022-10-04 09:39:50.420514+0200 App[61959:2477255] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
2022-10-04 09:39:50.420610+0200 App[61959:2477255] [ProcessSuspension] 0x110020360 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'GPUProcess Background Assertion' for process with PID=61970, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
2022-10-04 09:39:50.422690+0200 App[61959:2477255] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>

Info Ionic:

Ionic:

Ionic CLI : 6.20.1 (/opt/homebrew/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.2.5
@angular-devkit/build-angular : 14.2.1
@angular-devkit/schematics : 14.2.1
@angular/cli : 14.2.1
@ionic/angular-toolkit : 6.1.0

Capacitor:

Capacitor CLI : 4.1.0
@capacitor/android : not installed
@capacitor/core : 4.1.0
@capacitor/ios : 4.1.0

@jcesarmobile
Copy link
Member

Taking pictures requires a lot of memory, if the device is already low on memory because of background apps running then this can happen, the webview goes out of memory and restarts itself and capacitor reloads current url.

@jcesarmobile jcesarmobile closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2022
@chris087
Copy link
Author

chris087 commented Oct 5, 2022

This is not completely true, cause I can see my memory usage; And have 500 MBs free (photo takes +- 120 MB).
image

@chris087
Copy link
Author

chris087 commented Oct 5, 2022

Just crashed with 588 MB free RAM;

{"coords":{"accuracy":14.642268067987077,"speed":-1,"altitude":16.234542846679688,"altitudeAccuracy":25.084850311279297,"latitude":52.734988838405144,"heading":-1,"longitude":6.9070808946711626},"timestamp":1664952672345}
⚡️ To Native -> Camera getPhoto 74231214
2022-10-05 08:52:00.713505+0200 App[71657:2843584] [Process] 0x1130009d0 - [PID=71661] WebProcessProxy::didClose: (web process 0 crash)
2022-10-05 08:52:00.714189+0200 App[71657:2843584] [Process] 0x1130009d0 - [PID=71661] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash
2022-10-05 08:52:00.719714+0200 App[71657:2843584] [ProcessSuspension] 0x112020e40 - ProcessAssertion: Failed to acquire RBS Background assertion 'ConnectionTerminationWatchdog' for process because PID 0 is invalid
2022-10-05 08:52:00.723325+0200 App[71657:2853676] [ProcessSuspension] 0x112020e40 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=0, error: (null)
2022-10-05 08:52:00.730962+0200 App[71657:2843584] [Process] 0x10382b218 - [pageProxyID=7, webPageID=8, PID=71661] WebPageProxy::processDidTerminate: (pid 71661), reason=Crash
2022-10-05 08:52:00.814516+0200 App[71657:2843584] [Loading] 0x10382b218 - [pageProxyID=7, webPageID=8, PID=71661] WebPageProxy::dispatchProcessDidTerminate: reason=Crash
2022-10-05 08:52:00.962577+0200 App[71657:2853676] [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}>
2022-10-05 08:52:00.962742+0200 App[71657:2853676] [ProcessSuspension] 0x112020180 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'GPUProcess Background Assertion' for process with PID=71664, 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}
2022-10-05 08:52:01.422541+0200 App[71657:2843584] [Process] 0x112058220 - GPUProcessProxy::didClose:
2022-10-05 08:52:01.424747+0200 App[71657:2843584] [Process] 0x112058220 - GPUProcessProxy::gpuProcessExited: reason=Crash
2022-10-05 08:52:01.424830+0200 App[71657:2843584] [Process] 0x113001ac0 - [PID=0] WebProcessProxy::gpuProcessExited: reason=Crash
2022-10-05 08:52:01.427237+0200 App[71657:2843584] [ProcessSuspension] ProcessAssertion::remainingRunTimeInSeconds failed to get handle for process with PID=71664

@jcesarmobile
Copy link
Member

Either way webViewWebContentProcessDidTerminate is being called, we have no control over when it would be called, in some iOS versions it seems to be called more frequently than in others, ever if there is enough memory.
If you have a reliable reproduction you should report it to Apple on the webkit bug tracker https://bugs.webkit.org/.

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 10, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants