Skip to content

2.7.7: Crash in Persistence.archiveToFile(_:object:token:) #431

@igled7

Description

@igled7

We are getting crashes in the method Persistence.archiveToFile(_:object:token:)

This started happening after upgrading to the version 2.7.7. Everything was working fine with 2.7.0.

Environment

  • Xcode version: 11.7
  • Mixpanel SDK version: 2.7.7
  • Installation method: Carthage

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x4d55545a0000040 Persistence.archiveToFile

Crashed: com.mixpanel.archiveQueue
0  libswiftCore.dylib             0x19ff58b28 initializeWithCopy for Character + 20
1  libswiftCore.dylib             0x19fcd7d14 _SwiftDeferredNSDictionary.bridgeKeys() + 596
2  libswiftCore.dylib             0x19fcd8b94 _SwiftDeferredNSDictionary.getObjects(_:andKeys:count:) + 372
3  libswiftCore.dylib             0x19fce3a04 @objc _SwiftDeferredNSDictionary.getObjects(_:andKeys:count:) + 72
4  Foundation                     0x19d2806f4 -[NSDictionary(NSDictionary) encodeWithCoder:] + 244
5  Foundation                     0x19d3544f4 _encodeObject + 1212
6  Foundation                     0x19d25c534 -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] + 380
7  Foundation                     0x19d2808bc -[NSDictionary(NSDictionary) encodeWithCoder:] + 700
8  Foundation                     0x19d3544f4 _encodeObject + 1212
9  Foundation                     0x19d2a3260 +[NSKeyedArchiver archiveRootObject:toFile:] + 236
10 Mixpanel                       0x1075a3dbc closure #1 in static Persistence.archiveToFile(_:object:token:) + 163 (Persistence.swift:163)
11 Mixpanel                       0x10755fc44 thunk for @escaping @callee_guaranteed () -> () + 28 (<compiler-generated>:28)
12 Mixpanel                       0x10754bae0 +[ExceptionWrapper try:catch:finally:] + 15 (ExceptionWrapper.m:15)
13 Mixpanel                       0x1075a7a3c specialized static Persistence.archiveToFile(_:object:token:) + 1012 (<compiler-generated>:1012)
14 Mixpanel                       0x1075a3d08 closure #1 in static Persistence.archiveProperties(_:token:) + 2972 (<compiler-generated>:2972)
15 Mixpanel                       0x10755fbfc thunk for @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
16 Mixpanel                       0x10755fc1c thunk for @escaping @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
17 libdispatch.dylib              0x19bc19db0 _dispatch_client_callout + 20
18 libdispatch.dylib              0x19bc28428 _dispatch_lane_barrier_sync_invoke_and_complete + 60
19 Mixpanel                       0x1075a2ac4 static Persistence.archive(eventsQueue:peopleQueue:groupsQueue:properties:codelessBindings:variants:token:) + 1108 (<compiler-generated>:1108)
20 Mixpanel                       0x10756ae84 closure #1 in MixpanelInstance.archive() + 954 (MixpanelInstance.swift:954)
21 Mixpanel                       0x1075ffee8 closure #1 in ReadWriteLock.read(closure:) + 20 (ReadWriteLock.swift:20)
22 Mixpanel                       0x107575cc8 partial apply for thunk for @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
23 Mixpanel                       0x10755fc1c thunk for @escaping @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
24 libdispatch.dylib              0x19bc19db0 _dispatch_client_callout + 20
25 libdispatch.dylib              0x19bc28a54 _dispatch_sync_invoke_and_complete + 60
26 Mixpanel                       0x107566018 MixpanelInstance.archive() + 212 (<compiler-generated>:212)
27 Mixpanel                       0x107568274 protocol witness for FlushDelegate.updateQueue(_:type:) in conformance MixpanelInstance + 196 (<compiler-generated>:196)
28 Mixpanel                       0x10759d320 closure #1 in Flush.flushQueueInBatches(_:type:) + 696 (<compiler-generated>:696)
29 Mixpanel                       0x10762c2b4 partial apply for closure #2 in FlushRequest.sendRequest(_:type:useIP:completion:) + 24 (<compiler-generated>:24)
30 Mixpanel                       0x10762c428 partial apply for closure #2 in FlushRequest.flushRequestHandler(_:resource:completion:) + 164 (<compiler-generated>:164)
31 Mixpanel                       0x10762c454 partial apply for thunk for @escaping @callee_guaranteed (@unowned Int, @guaranteed NSURLResponse?) -> () + 24 (<compiler-generated>:24)
32 Mixpanel                       0x1075b9ff4 specialized closure #1 in static Network.apiRequest<A>(base:resource:failure:success:) + 436 (<compiler-generated>:436)
33 Mixpanel                       0x1075bbfe8 partial apply for specialized closure #1 in static Network.apiRequest<A>(base:resource:failure:success:) + 36
34 Mixpanel                       0x1075ba2a4 thunk for @escaping @callee_guaranteed (@guaranteed Data?, @guaranteed NSURLResponse?, @guaranteed Error?) -> () + 148 (<compiler-generated>:148)
35 CFNetwork                      0x19c642d60 CFNetServiceBrowserSearchForServices + 79492
36 CFNetwork                      0x19c655390 _CFHTTPMessageSetResponseProxyURL + 9200
37 libdispatch.dylib              0x19bc1824c _dispatch_call_block_and_release + 32
38 libdispatch.dylib              0x19bc19db0 _dispatch_client_callout + 20
39 libdispatch.dylib              0x19bc2110c _dispatch_lane_serial_drain + 580
40 libdispatch.dylib              0x19bc21c90 _dispatch_lane_invoke + 460
41 libdispatch.dylib              0x19bc2bd78 _dispatch_workloop_worker_thread + 708
42 libsystem_pthread.dylib        0x1e7ad5814 _pthread_wqthread + 276
43 libsystem_pthread.dylib        0x1e7adc76c start_wqthread + 8

EXC_BREAKPOINT 0x00000001a45f151c Persistence.archiveToFile

Crashed: com.mixpanel.archiveQueue
0  CoreFoundation                 0x1a45f151c _CFCreateArrayStorage.cold.2 + 16
1  CoreFoundation                 0x1a44ab8e4 +[__NSArrayM automaticallyNotifiesObserversForKey:] + 114
2  Foundation                     0x1a57566b4 -[NSDictionary(NSDictionary) encodeWithCoder:] + 188
3  Foundation                     0x1a581dce0 _encodeObject + 1208
4  Foundation                     0x1a5734208 -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] + 376
5  Foundation                     0x1a57568b0 -[NSDictionary(NSDictionary) encodeWithCoder:] + 696
6  Foundation                     0x1a581dce0 _encodeObject + 1208
7  Foundation                     0x1a57775b8 +[NSKeyedArchiver archiveRootObject:toFile:] + 232
8  Mixpanel                       0x10746fdbc closure #1 in static Persistence.archiveToFile(_:object:token:) + 163 (Persistence.swift:163)
9  Mixpanel                       0x10742bc44 thunk for @escaping @callee_guaranteed () -> () + 28 (<compiler-generated>:28)
10 Mixpanel                       0x107417ae0 +[ExceptionWrapper try:catch:finally:] + 15 (ExceptionWrapper.m:15)
11 Mixpanel                       0x107473a3c specialized static Persistence.archiveToFile(_:object:token:) + 1012 (<compiler-generated>:1012)
12 Mixpanel                       0x10746fd08 closure #1 in static Persistence.archiveProperties(_:token:) + 2972 (<compiler-generated>:2972)
13 Mixpanel                       0x10742bbfc thunk for @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
14 Mixpanel                       0x10742bc1c thunk for @escaping @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
15 libdispatch.dylib              0x1a41c2280 _dispatch_client_callout + 16
16 libdispatch.dylib              0x1a41a50ec _dispatch_lane_barrier_sync_invoke_and_complete + 56
17 Mixpanel                       0x10746eac4 static Persistence.archive(eventsQueue:peopleQueue:groupsQueue:properties:codelessBindings:variants:token:) + 1108 (<compiler-generated>:1108)
18 Mixpanel                       0x107436e84 closure #1 in MixpanelInstance.archive() + 954 (MixpanelInstance.swift:954)
19 Mixpanel                       0x1074cbee8 closure #1 in ReadWriteLock.read(closure:) + 20 (ReadWriteLock.swift:20)
20 Mixpanel                       0x107441cc8 partial apply for thunk for @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
21 Mixpanel                       0x10742bc1c thunk for @escaping @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
22 libdispatch.dylib              0x1a41c2280 _dispatch_client_callout + 16
23 libdispatch.dylib              0x1a41a56cc _dispatch_sync_invoke_and_complete + 56
24 Mixpanel                       0x107432018 MixpanelInstance.archive() + 212 (<compiler-generated>:212)
25 Mixpanel                       0x107434274 protocol witness for FlushDelegate.updateQueue(_:type:) in conformance MixpanelInstance + 196 (<compiler-generated>:196)
26 Mixpanel                       0x107469320 closure #1 in Flush.flushQueueInBatches(_:type:) + 696 (<compiler-generated>:696)
27 Mixpanel                       0x1074f82b4 partial apply for closure #2 in FlushRequest.sendRequest(_:type:useIP:completion:) + 24 (<compiler-generated>:24)
28 Mixpanel                       0x1074f8428 partial apply for closure #2 in FlushRequest.flushRequestHandler(_:resource:completion:) + 164 (<compiler-generated>:164)
29 Mixpanel                       0x1074f8454 partial apply for thunk for @escaping @callee_guaranteed (@unowned Int, @guaranteed NSURLResponse?) -> () + 24 (<compiler-generated>:24)
30 Mixpanel                       0x107485ff4 specialized closure #1 in static Network.apiRequest<A>(base:resource:failure:success:) + 436 (<compiler-generated>:436)
31 Mixpanel                       0x107487fe8 partial apply for specialized closure #1 in static Network.apiRequest<A>(base:resource:failure:success:) + 36
32 Mixpanel                       0x1074862a4 thunk for @escaping @callee_guaranteed (@guaranteed Data?, @guaranteed NSURLResponse?, @guaranteed Error?) -> () + 148 (<compiler-generated>:148)
33 CFNetwork                      0x1a4b7f728 CFNetServiceBrowserSearchForServices + 75936
34 CFNetwork                      0x1a4b901f8 _CFHTTPMessageSetResponseProxyURL + 9332
35 libdispatch.dylib              0x1a41c1298 _dispatch_call_block_and_release + 24
36 libdispatch.dylib              0x1a41c2280 _dispatch_client_callout + 16
37 libdispatch.dylib              0x1a419e4f0 _dispatch_lane_serial_drain$VARIANT$armv81 + 568
38 libdispatch.dylib              0x1a419f010 _dispatch_lane_invoke$VARIANT$armv81 + 456
39 libdispatch.dylib              0x1a41a8800 _dispatch_workloop_worker_thread + 692
40 libsystem_pthread.dylib        0x1ecd195a4 _pthread_wqthread + 272
41 libsystem_pthread.dylib        0x1ecd1c874 start_wqthread + 8

EXC_BAD_ACCESS KERN_PROTECTION_FAILURE 0x00000058877e4c50 MixpanelInstance.archive()

Crashed: com.mixpanel.globallock
0  libswiftCore.dylib             0x19fd703c8 _swift_release_dealloc + 24
1  Mixpanel                       0x107d92e9c closure #1 in MixpanelInstance.archive() + 892 (<compiler-generated>:892)
2  Mixpanel                       0x107e27ee8 closure #1 in ReadWriteLock.read(closure:) + 20 (ReadWriteLock.swift:20)
3  Mixpanel                       0x107d9dcc8 partial apply for thunk for @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
4  Mixpanel                       0x107d87c1c thunk for @escaping @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
5  libdispatch.dylib              0x19ba01db0 _dispatch_client_callout + 20
6  libdispatch.dylib              0x19ba10a54 _dispatch_sync_invoke_and_complete + 60
7  Mixpanel                       0x107d8e018 MixpanelInstance.archive() + 212 (<compiler-generated>:212)
8  Mixpanel                       0x107d90274 protocol witness for FlushDelegate.updateQueue(_:type:) in conformance MixpanelInstance + 196 (<compiler-generated>:196)
9  Mixpanel                       0x107dc5320 closure #1 in Flush.flushQueueInBatches(_:type:) + 696 (<compiler-generated>:696)
10 Mixpanel                       0x107e542b4 partial apply for closure #2 in FlushRequest.sendRequest(_:type:useIP:completion:) + 24 (<compiler-generated>:24)
11 Mixpanel                       0x107e54428 partial apply for closure #2 in FlushRequest.flushRequestHandler(_:resource:completion:) + 164 (<compiler-generated>:164)
12 Mixpanel                       0x107e54454 partial apply for thunk for @escaping @callee_guaranteed (@unowned Int, @guaranteed NSURLResponse?) -> () + 24 (<compiler-generated>:24)
13 Mixpanel                       0x107de1ff4 specialized closure #1 in static Network.apiRequest<A>(base:resource:failure:success:) + 436 (<compiler-generated>:436)
14 Mixpanel                       0x107de3fe8 partial apply for specialized closure #1 in static Network.apiRequest<A>(base:resource:failure:success:) + 36
15 Mixpanel                       0x107de22a4 thunk for @escaping @callee_guaranteed (@guaranteed Data?, @guaranteed NSURLResponse?, @guaranteed Error?) -> () + 148 (<compiler-generated>:148)
16 CFNetwork                      0x19c42af18 CFNetServiceBrowserSearchForServices + 79492
17 CFNetwork                      0x19c43d548 _CFHTTPMessageSetResponseProxyURL + 9200
18 libdispatch.dylib              0x19ba0024c _dispatch_call_block_and_release + 32
19 libdispatch.dylib              0x19ba01db0 _dispatch_client_callout + 20
20 libdispatch.dylib              0x19ba0910c _dispatch_lane_serial_drain + 580
21 libdispatch.dylib              0x19ba09c90 _dispatch_lane_invoke + 460
22 libdispatch.dylib              0x19ba13d78 _dispatch_workloop_worker_thread + 708
23 libsystem_pthread.dylib        0x1e75df804 _pthread_wqthread + 276
24 libsystem_pthread.dylib        0x1e75e675c start_wqthread + 8

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000714c5ea34620 Persistence.archiveProperties(_:token:)

Crashed: com.mixpanel.archiveQueue
0  libswiftCore.dylib             0x199a61708 _swift_release_dealloc + 16
1  libswiftCore.dylib             0x199a5786c swift_arrayDestroy + 68
2  libswiftCore.dylib             0x199811290 _DictionaryStorage.deinit + 404
3  libswiftCore.dylib             0x199811308 _DictionaryStorage.__deallocating_deinit + 12
4  libswiftCore.dylib             0x199a61714 _swift_release_dealloc + 28
5  Mixpanel                       0x105acbd10 closure #1 in static Persistence.archiveProperties(_:token:) + 130 (Persistence.swift:130)
6  Mixpanel                       0x105a87bfc thunk for @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
7  Mixpanel                       0x105a87c1c thunk for @escaping @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
8  libdispatch.dylib              0x1959ea280 _dispatch_client_callout + 16
9  libdispatch.dylib              0x1959cd0f4 _dispatch_lane_barrier_sync_invoke_and_complete + 56
10 Mixpanel                       0x105acaac4 static Persistence.archive(eventsQueue:peopleQueue:groupsQueue:properties:codelessBindings:variants:token:) + 1108 (<compiler-generated>:1108)
11 Mixpanel                       0x105a92e84 closure #1 in MixpanelInstance.archive() + 954 (MixpanelInstance.swift:954)
12 Mixpanel                       0x105b27ee8 closure #1 in ReadWriteLock.read(closure:) + 20 (ReadWriteLock.swift:20)
13 Mixpanel                       0x105a9dcc8 partial apply for thunk for @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
14 Mixpanel                       0x105a87c1c thunk for @escaping @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
15 libdispatch.dylib              0x1959ea280 _dispatch_client_callout + 16
16 libdispatch.dylib              0x1959cd6d4 _dispatch_sync_invoke_and_complete + 56
17 Mixpanel                       0x105a8e018 MixpanelInstance.archive() + 212 (<compiler-generated>:212)
18 Mixpanel                       0x105a90274 protocol witness for FlushDelegate.updateQueue(_:type:) in conformance MixpanelInstance + 196 (<compiler-generated>:196)
19 Mixpanel                       0x105ac5320 closure #1 in Flush.flushQueueInBatches(_:type:) + 696 (<compiler-generated>:696)
20 Mixpanel                       0x105b542b4 partial apply for closure #2 in FlushRequest.sendRequest(_:type:useIP:completion:) + 24 (<compiler-generated>:24)
21 Mixpanel                       0x105b54428 partial apply for closure #2 in FlushRequest.flushRequestHandler(_:resource:completion:) + 164 (<compiler-generated>:164)
22 Mixpanel                       0x105b54454 partial apply for thunk for @escaping @callee_guaranteed (@unowned Int, @guaranteed NSURLResponse?) -> () + 24 (<compiler-generated>:24)
23 Mixpanel                       0x105ae1ff4 specialized closure #1 in static Network.apiRequest<A>(base:resource:failure:success:) + 436 (<compiler-generated>:436)
24 Mixpanel                       0x105ae3fe8 partial apply for specialized closure #1 in static Network.apiRequest<A>(base:resource:failure:success:) + 36
25 Mixpanel                       0x105ae22a4 thunk for @escaping @callee_guaranteed (@guaranteed Data?, @guaranteed NSURLResponse?, @guaranteed Error?) -> () + 148 (<compiler-generated>:148)
26 CFNetwork                      0x1963a0540 CFNetServiceBrowserSearchForServices + 75744
27 CFNetwork                      0x1963b1010 _CFHTTPMessageSetResponseProxyURL + 9332
28 libdispatch.dylib              0x1959e9298 _dispatch_call_block_and_release + 24
29 libdispatch.dylib              0x1959ea280 _dispatch_client_callout + 16
30 libdispatch.dylib              0x1959c64fc _dispatch_lane_serial_drain$VARIANT$armv81 + 568
31 libdispatch.dylib              0x1959c701c _dispatch_lane_invoke$VARIANT$armv81 + 456
32 libdispatch.dylib              0x1959d0808 _dispatch_workloop_worker_thread + 692
33 libsystem_pthread.dylib        0x1db6045a4 _pthread_wqthread + 272
34 libsystem_pthread.dylib        0x1db607874 start_wqthread + 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions