OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.16k stars 6.41k forks source link

[BUG][SWIFT] : Crashed: SynchronizedDictionary EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 #19143

Open kanduvisla opened 1 month ago

kanduvisla commented 1 month ago
Description

The Swift client code that is created occasionally causes the iOS App to crash. I can't clearly put my finger on it, but I get the following report in Crashlytics:

Crashed: SynchronizedDictionary
0  <MY_APP>                       0x2da596c specialized closure #1 in SynchronizedDictionary.subscript.getter + 1 (URLSessionImplementations.swift:1)
1  <MY_APP>                       0x2e6ca40 partial apply for thunk for @callee_guaranteed () -> () + 4413295168 (<compiler-generated>:4413295168)
2  <MY_APP>                       0x2fa6198 thunk for @escaping @callee_guaranteed () -> () + 1 (URLSessionImplementations.swift:1)
3  libdispatch.dylib              0x3dd4 _dispatch_client_callout + 20
4  libdispatch.dylib              0x136f8 _dispatch_sync_invoke_and_complete_recurse + 64
5  libdispatch.dylib              0x13178 _dispatch_sync_f_slow + 176
6  <MY_APP>                       0x320b32c specialized SynchronizedDictionary.subscript.getter + 24 (SynchronizedDictionary.swift:24)
7  <MY_APP>                       0x329431c specialized SessionDelegate.urlSession(_:task:didReceive:completionHandler:) + 353 (URLSessionImplementations.swift:353)
8  <MY_APP>                       0x3149d10 @objc SessionDelegate.urlSession(_:task:didReceive:completionHandler:) + 1 (URLSessionImplementations.swift:1)
9  CFNetwork                      0xfa22c _CFHostIsDomainTopLevel + 93228
10 libdispatch.dylib              0x213c _dispatch_call_block_and_release + 32
11 libdispatch.dylib              0x3dd4 _dispatch_client_callout + 20
12 libdispatch.dylib              0xb400 _dispatch_lane_serial_drain + 748
13 libdispatch.dylib              0xbf64 _dispatch_lane_invoke + 432
14 libdispatch.dylib              0x16cb4 _dispatch_root_queue_drain_deferred_wlh + 288
15 libdispatch.dylib              0x16528 _dispatch_workloop_worker_thread + 404
16 libsystem_pthread.dylib        0x4934 _pthread_wqthread + 288
17 libsystem_pthread.dylib        0x10cc start_wqthread + 8

I really have no idea what might be causing this, and my inner depth of iOS / Swift / XCode is lacking to find the root cause of this issue, so anything that might be helpfull is welcome.

openapi-generator version

The Client is built with 7.3.0

wing328 commented 1 month ago

The Client is built with 7.3.0

can you try generating the swift client using v7.7.0 of openapi generator (latest stable version) and see if the issue persists?