GoogleCloudPlatform / recaptcha-enterprise-mobile-sdk

Apache License 2.0
31 stars 6 forks source link

Crash inside `[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]` #89

Closed nalexn closed 9 months ago

nalexn commented 9 months ago

Describe the bug

SDK crash

Integration Method

SDK Version 18.4.1

To Reproduce

Unknown

Xcode version for iOS (please complete the following information):

Device (please complete the following information):

Add any other context about the problem here.

EXC_BREAKPOINT: KERN_INVALID_ADDRESS

0  WebKit +0x4c78                  WTFCrashWithInfo(int, char const*, char const*, int)
1  WebKit +0x722424                WebKit::WebProcessPool::pageEndUsingWebsiteDataStore(WebKit::WebPageProxy&, WebKit::WebsiteDataStore&)
2  WebKit +0x72c8fc                WebKit::WebProcessProxy::removeWebPage(WebKit::WebPageProxy&, WebKit::WebProcessProxy::EndsUsingDataStore)
3  WebKit +0x6bfa10                WebKit::WebPageProxy::launchProcess(WebCore::RegistrableDomain const&, WebKit::WebPageProxy::ProcessLaunchReason)
4  WebKit +0x6c4ac0                WebKit::WebPageProxy::loadData(std::__1::span<unsigned char const, 18446744073709551615ul> const&, WTF::String const&, WTF::String const&, WTF::String const&, API::Object*, WebCore::ShouldOpenExternalURLsPolicy)
5  WebKit +0x39a2bc                -[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]
6  OPCoreServices +0x928b20        eIRO5Vdm.lUjPgPcG(pDrEJCxz:qeKfDafo:)
7  OPCoreServices +0x931ef4        gu1yWU2E.p1DeDT1X(pDrEJCxz:qeKfDafo:)
8  OPCoreServices +0x92dc40        closure #1 in trsOYNzb.webViewWebContentProcessDidTerminate(_:)
9  OPCoreServices +0x925ad8        closure #1 in pjDdaVGx.t5ajCXpG(url:yknbnetv:siteKey:tMOFpA5Q:completionHandler:)
10 OPCoreServices +0x92844c        partial apply for closure #1 in pjDdaVGx.t5ajCXpG(url:yknbnetv:siteKey:tMOFpA5Q:completionHandler:)
11 OpenPhoneCoreServices +0x9285f0 specialized pjDdaVGx.gJUJkqet(dataNullable:urlResponse:error:completionHandler:)
12 OpenPhoneCoreServices +0x90651c thunk for @escaping @callee_guaranteed @Sendable (@guaranteed Data?, @guaranteed NSURLResponse?, @guaranteed Error?) -> ()
13 CFNetwork +0xf284               0x188e5c284 (0x188e5c0a4 + 480)
14 CFNetwork +0x2d188              0x188e7a188 (0x188e7a0ec + 156)
15 libdispatch.dylib +0x26a4       __dispatch_call_block_and_release
16 libdispatch.dylib +0x42fc       __dispatch_client_callout
17 libdispatch.dylib +0xb890       __dispatch_lane_serial_drain
18 libdispatch.dylib +0xc3f4       __dispatch_lane_invoke
19 libdispatch.dylib +0x17000      __dispatch_root_queue_drain_deferred_wlh
20 libdispatch.dylib +0x16874      __dispatch_workloop_worker_thread
21 libsystem_pthread.dylib +0x1960 __pthread_wqthread
walterjgsp commented 9 months ago

Hi @nalexn, thanks for the report. What's the version of the SDK that you're using? 18.4.1?

nalexn commented 9 months ago

Yes, 18.4.1 for iOS

walterjgsp commented 9 months ago

Thanks @nalexn, here are some follow up questions that will help us investigate.

Are you seeing this on production or development? How often does it happen?

nalexn commented 9 months ago

This is production, repro steps are unknown. 100% of the crashes happen when the app is backgrounded. There are some instances when the app received a background fetch request and was activated prior to crashing. However, most of the logs indicate the crash doesn't happen immediately after app launch, user manages to navigate in the app for some time and minimizes the app. But I cannot see a pattern, user paths seem random and don't have much in common.

We've made a release with this SDK version yesterday, currently at 1% rollout, but this crash is already top 1 (#88 is on second place) in the list.

walterjgsp commented 9 months ago

We have released version 18.4.2, which should address the issue. Please let us know if you continue to experience errors.

walterjgsp commented 9 months ago

By https://github.com/GoogleCloudPlatform/recaptcha-enterprise-mobile-sdk/issues/90 this bug should be solved in the version 18.4.2. Please reopen the bug if this issue appears in the new version of the SDK.