RESOLVED FIXED289459
Crash on opening camera from Webview in iOS 18.4
https://bugs.webkit.org/show_bug.cgi?id=289459
Summary Crash on opening camera from Webview in iOS 18.4
pranavkth
Reported 2025-03-10 05:38:26 PDT
Notes: - Able to reproduce everytime in iOS 18.4 beta. - Not happening in iOS 18.3 stable version. Stack Trace: * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x1a6efe5b8) frame #0: 0x00000001a6efe5b8 WebCore`WebCore::BaseAudioSharedUnit::BaseAudioSharedUnit() + 668 frame #1: 0x00000001a6efe044 WebCore`WebCore::CoreAudioSharedUnit::singleton() + 80 frame #2: 0x00000001a9521fe4 WebCore`WebCore::CoreAudioCaptureSource::create(WebCore::CaptureDevice const&, WebCore::MediaDeviceHashSalts&&, WebCore::MediaConstraints const*, std::__1::optional<WTF::ObjectIdentifierGeneric<WebCore::PageIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits<unsigned long long>, unsigned long long>>) + 360 frame #3: 0x00000001a94f180c WebCore`WebCore::RealtimeMediaSourceCenter::getUserMediaDevices(WebCore::MediaStreamRequest const&, WebCore::MediaDeviceHashSalts&&, WTF::Vector<WebCore::RealtimeMediaSourceCenter::DeviceInfo, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&, WTF::Vector<WebCore::RealtimeMediaSourceCenter::DeviceInfo, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&, WebCore::MediaConstraintType&) + 356 frame #4: 0x00000001a94f22cc WebCore`WebCore::RealtimeMediaSourceCenter::validateRequestConstraintsAfterEnumeration(WTF::Function<void (WTF::Vector<WebCore::CaptureDevice, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&, WTF::Vector<WebCore::CaptureDevice, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>&&, WTF::Function<void (WebCore::MediaConstraintType)>&&, WebCore::MediaStreamRequest const&, WebCore::MediaDeviceHashSalts&&) + 356 frame #5: 0x00000001a94fb394 WebCore`WTF::Detail::CallableWrapper<WebCore::RealtimeMediaSourceCenter::enumerateDevices(bool, bool, bool, bool, WTF::CompletionHandler<void ()>&&)::$_0, void>::~CallableWrapper() + 164 frame #6: 0x00000001a814bbe8 WebCore`WTF::Detail::CallableWrapper<WebCore::AVCaptureDeviceManager::refreshCaptureDevicesInternal(WTF::CompletionHandler<void ()>&&, WebCore::AVCaptureDeviceManager::ShouldSetUserPreferredCamera)::$_0::operator()()::'lambda'(), void>::call() + 520 frame #7: 0x00000001ab7f1aac JavaScriptCore`WTF::RunLoop::performWork() + 524 frame #8: 0x00000001ab7f1880 JavaScriptCore`WTF::RunLoop::performWork(void*) + 36 frame #9: 0x00000001935e7d0c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 frame #10: 0x00000001935e7ca0 CoreFoundation`__CFRunLoopDoSource0 + 172 frame #11: 0x00000001935e6a24 CoreFoundation`__CFRunLoopDoSources0 + 232 frame #12: 0x00000001935e5c64 CoreFoundation`__CFRunLoopRun + 840 frame #13: 0x000000019360a730 CoreFoundation`CFRunLoopRunSpecific + 572 frame #14: 0x00000001e0fb5190 GraphicsServices`GSEventRunModal + 168 frame #15: 0x0000000196239f34 UIKitCore`-[UIApplication _run] + 816 frame #16: 0x0000000196238164 UIKitCore`UIApplicationMain + 336 * frame #17: 0x000000010811bec4 AppName.debug.dylib`main at AppDelegate.swift:25:13 frame #18: 0x00000001bae06a58 dyld`start + 5964
Attachments
Stack Trace of Webcore crash on opening camera from webview. (2.94 KB, text/plain)
2025-03-10 20:11 PDT, pranavkth
no flags
Alexey Proskuryakov
Comment 1 2025-03-10 14:00:38 PDT
Thank you for the report! Could you please attach a full crash log, and/or provide detailed steps to reproduce?
Radar WebKit Bug Importer
Comment 2 2025-03-10 14:00:52 PDT
pranavkth
Comment 3 2025-03-10 20:11:25 PDT
Created attachment 474516 [details] Stack Trace of Webcore crash on opening camera from webview.
pranavkth
Comment 4 2025-03-10 20:12:19 PDT
(In reply to Alexey Proskuryakov from comment #1) > Thank you for the report! Could you please attach a full crash log, and/or > provide detailed steps to reproduce? Added the attachment. Please check.
pranavkth
Comment 5 2025-04-01 21:47:01 PDT
Hi Team, This is happening on iOS 18.4 stable version as well. Please check.
infoforket
Comment 6 2025-04-01 23:14:27 PDT
What is the update on this? Can someone please let us know if there an expected fix date for this issue? Any findings so far?
ajaymati1000
Comment 7 2025-04-04 00:12:49 PDT
Before Apple publishes the fix, this is the hack that I have found. Prewarming the capture device(here is the camera) helps fix the crash. Get all the necessary permissions and then write down this anywhere before you enter into the web camera flow. ``` let _ = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .front) ```
youenn fablet
Comment 8 2025-04-23 01:34:24 PDT
youenn fablet
Comment 9 2025-04-23 01:51:47 PDT
ajaymati1000
Comment 10 2025-04-23 03:28:32 PDT
(In reply to youenn fablet from comment #9) > <rdar://148431362> Any work around for this before the release happens? is there any tentative date of release?
EWS
Comment 11 2025-04-23 11:02:58 PDT
Committed 294012@main (0c52e49e06e6): <https://commits.webkit.org/294012@main> Reviewed commits have been landed. Closing PR #44408 and removing active labels.
youenn fablet
Comment 12 2025-04-24 04:55:01 PDT
The only workaround for this bug until the fix is for the application to not use UIWebView when trying to capture microphone. Capturing camera alone should be fine.
EWS
Comment 13 2025-04-30 14:32:08 PDT
Committed 289651.474@safari-7621-branch (e6de07abb032): <https://commits.webkit.org/289651.474@safari-7621-branch> Reviewed commits have been landed. Closing PR #3047 and removing active labels.
pranavkth
Comment 14 2025-05-07 02:34:43 PDT
Hi Team, Please confirm the iOS version which will have this fix.
Note You need to log in before you can comment on or make changes to this bug.