Post

Replies

Boosts

Views

Activity

Reply to Xcode 26 crash upon dealloc of `WKNavigationResponse` on Main Thread
And for anybody who's interested into running the same: // // WebKitCrashTests.swift // WebKitCrashTests // // Created by Luca Archidiacono on 27.10.2025. // import Foundation import WebKit final class WKNavigationResponeMock: WKNavigationResponse { private let urlResponse: URLResponse override var response: URLResponse { urlResponse } init(urlResponse: URLResponse) { self.urlResponse = urlResponse super.init() } convenience init(httpUrlResponse: HTTPURLResponse) { self.init(urlResponse: httpUrlResponse) } convenience init?(url: URL, statusCode: Int) { guard let httpURLResponse = HTTPURLResponse(url: url, statusCode: statusCode, httpVersion: nil, headerFields: nil) else { return nil } self.init(httpUrlResponse: httpURLResponse) } } import WebKit import XCTest final class WebKitCrashTests: XCTestCase { @MainActor func testAllocAndDeallocWKNavigationResponse() { let expectedURL = URL(string: "https://galaxus.ch/")! let expectedStatusCode = 404 guard let expectedResponse = WKNavigationResponeMock(url: expectedURL, statusCode: expectedStatusCode) else { assertionFailure("Should be not nil") return } XCTAssertEqual(expectedResponse.response.url, expectedURL) } } This should work now ;)
Topic: Safari & Web SubTopic: General Tags:
Oct ’25
Reply to Xcode 26 crash upon dealloc of `WKNavigationResponse` on Main Thread
Thank you for the feedback and the insight! Weird that my code snippet was not properly provided via Feedback Assistant. Never less, I uploaded more attachments ;) Regarding your investigation. After creating a fresh project with Xcode and attaching the same code snippet into it, I have also found a similar stacktrace as yours. Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 JavaScriptCore 0x1998806d4 WTF::RunLoop::dispatch(WTF::Function<void ()>&&) + 48 1 WebCore 0x18f8a6820 WebCoreObjCScheduleDeallocateOnMainRunLoop(objc_class*, objc_object*) + 76 2 WebKit 0x18d8ae10c -[WKNavigationResponse dealloc] + 40 3 WebKitCrashTests 0x1039edbb8 WebKitCrashTests.testAllocAndDeallocWKNavigationResponse() + 748 (WebKitCrashTests.swift:49) 4 WebKitCrashTests 0x1039edea4 @objc WebKitCrashTests.testAllocAndDeallocWKNavigationResponse() + 44 WebKitCrash-2025-10-27-083659.ips Thank you for pointing me toward the open-source WebKit repository and indicating where the crash might be occurring. I find it strange that this issue appears only after Xcode 26.0.0, especially since the line of code you referenced hasn’t changed in over three years. What could have changed internally to cause this new behavior?
Topic: Safari & Web SubTopic: General Tags:
Oct ’25