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

Crash - CompositeEventMonitor.request<A>(_:didParseResponse:) #3667

Open
1 task done
tamvutdt opened this issue Nov 25, 2022 · 2 comments
Open
1 task done

Crash - CompositeEventMonitor.request<A>(_:didParseResponse:) #3667

tamvutdt opened this issue Nov 25, 2022 · 2 comments
Assignees
Labels
awaiting response Issues awaits response from reporter.

Comments

@tamvutdt
Copy link

tamvutdt commented Nov 25, 2022

ℹ Please fill out this template when filing an issue.
All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.

Per our *CONTRIBUTING guidelines, we use GitHub for
bugs and feature requests, not general support. Other issues should be opened on Stack Overflow with the tag alamofire.

Please remove this line and everything above it before submitting.

What did you do?

I've created and publish an application on iOS, this application use Alamofire v5.4.3 to communicate with the restful api. We also shipped the application with Firebase Crashlytics, and I received some crash logs which related to Alamofire. I've attached the crash log below. Please check it for me.

iPhone 12 Pro/ iOS 16.0.0

What did you expect to happen?

No crash

What happened instead?

Crash

Alamofire Environment

Alamofire Version: 5.4.3
Dependency Manager: Swift Package Manager
Xcode Version: XCode 14.1
Swift Version: Swift 5.7
Platform(s) Running Alamofire: iOS 16.0.0
macOS Version Running Xcode: 12.6.1

Demo Project

Crashed: com.apple.main-thread

0 libobjc.A.dylib 0x21f94 objc_class::isInitialized() + 36
1 libobjc.A.dylib 0x794c lookUpImpOrForward + 60
2 libobjc.A.dylib 0x20c4 _objc_msgSend_uncached + 68
3 CoreFoundation 0x7a6f8 __CFBasicHashDrain + 320
4 CoreFoundation 0x7ed20 _CFRelease + 316
5 CFNetwork 0x5da80 CFHTTPCookieStorageCreateFromFile + 4332
6 CoreFoundation 0x7ed20 _CFRelease + 316
7 CFNetwork 0x167c8 CFURLRequestSetURL + 6816
8 CoreFoundation 0x7ed20 _CFRelease + 316
9 CFNetwork 0x1070cc _CFURLConnectionCopyTimingData + 16068
10 libobjc.A.dylib 0x14a4 object_cxxDestructFromClass(objc_object*, objc_class*) + 116
11 libobjc.A.dylib 0x621c objc_destructInstance + 80
12 libobjc.A.dylib 0xf9d0 _objc_rootDealloc + 80
13 CFNetwork 0x832fc CFURLResponseCreateWithHTTPResponse + 69584
14 CFNetwork 0x84834 CFURLResponseCreateWithHTTPResponse + 75016
15 CFNetwork 0x83e34 CFURLResponseCreateWithHTTPResponse + 72456
16 CFNetwork 0x479dc CFURLCacheRemoveAllCachedResponses + 11992
17 libobjc.A.dylib 0x14a4 object_cxxDestructFromClass(objc_object*, objc_class*) + 116
18 libobjc.A.dylib 0x621c objc_destructInstance + 80
19 libobjc.A.dylib 0xf9d0 _objc_rootDealloc + 80
20 CoreFoundation 0x6b5b0 RELEASE_OBJECTS_IN_THE_ARRAY + 112
21 CoreFoundation 0x6b720 -[__NSArrayM dealloc] + 268
22 CFNetwork 0xe770 CFURLCacheSetMemoryCapacity + 3764
23 libobjc.A.dylib 0x14a4 object_cxxDestructFromClass(objc_object*, objc_class*) + 116
24 libobjc.A.dylib 0x621c objc_destructInstance + 80
25 libobjc.A.dylib 0xf9d0 _objc_rootDealloc + 80
26 libobjc.A.dylib 0x14a4 object_cxxDestructFromClass(objc_object*, objc_class*) + 116
27 libobjc.A.dylib 0x621c objc_destructInstance + 80
28 libobjc.A.dylib 0xf9d0 objc_rootDealloc + 80
29 MyApp 0x1398c8c CompositeEventMonitor.request(
:didParseResponse:) + 4324576396
30 libswiftCore.dylib 0x3da1d4 _swift_release_dealloc + 56
31 MyApp 0x13a1e44 outlined init with copy of AFError? + 4324613700
32 libswiftCore.dylib 0x3da1d4 _swift_release_dealloc + 56
33 libsystem_blocks.dylib 0x2124 _call_dispose_helpers_excp + 48
34 libsystem_blocks.dylib 0x1d54 _Block_release + 252
35 libdispatch.dylib 0x3fdc dispatch_client_callout + 20
36 libdispatch.dylib 0x127f4 dispatch_main_queue_drain + 928
37 libdispatch.dylib 0x12444 dispatch_main_queue_callback_4CF + 44
38 CoreFoundation 0x9aa08 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16
39 CoreFoundation 0x7c368 __CFRunLoopRun + 2036
40 CoreFoundation 0x811e4 CFRunLoopRunSpecific + 612
41 GraphicsServices 0x1368 GSEventRunModal + 164
42 UIKitCore 0x3a2d88 -[UIApplication run] + 888
43 UIKitCore 0x3a29ec UIApplicationMain + 340
44 libswiftUIKit.dylib 0x352a0 UIApplicationMain(
:
:
:
:) + 104
45 MyApp 0x8abc main + 4304063164 (IdeasAnalystCallScreen.swift:4304063164)
46 ??? 0x1b1609948 (Missing)

@jshier
Copy link
Contributor

jshier commented Dec 10, 2022

Are you using any EventMonitors? If not, you can essentially turn the feature off by passing an empty array when you create your Session instance: Session(..., eventMonitors: []). This may prevent capture by by the CompositeEventMonitor that may be the cause of this issue.

If you are using EventMonitors, an example of your usage may help investigate what's happening.

@jshier jshier self-assigned this Dec 10, 2022
@jshier jshier added the awaiting response Issues awaits response from reporter. label Dec 10, 2022
@ejensen
Copy link
Contributor

ejensen commented Feb 5, 2023

Are you using any EventMonitors? If not, you can essentially turn the feature off by passing an empty array when you create your Session instance: Session(..., eventMonitors: []). This may prevent capture by by the CompositeEventMonitor that may be the cause of this issue.

@jshier I'm witnessing a similar crash in the CompositeEventMonitor's iteration of monitors. The app is specifying an empty event monitors array (Session(..., eventMonitors: [])) yet an a CompositeEventMonitor is still created with the defaultEventMonitors (AlamofireNotifications). There currently is no way to avoid making the CompositeEventMonitor and AlamofireNotifications in order to avoid the crash. Would it be possible to make the default eventMonitors parameter value be defaultEventMonitors instead of always prepending the defaultEventMonitors to the supplied eventMonitors array? That would allow callers to prevent initializing event monitors they do not intend on using.

EventMonitor CallStack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Issues awaits response from reporter.
Projects
None yet
Development

No branches or pull requests

3 participants