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

EXC_BAD_ACCESS when starting app #645

Closed
jleprinc opened this issue May 2, 2024 · 1 comment
Closed

EXC_BAD_ACCESS when starting app #645

jleprinc opened this issue May 2, 2024 · 1 comment

Comments

@jleprinc
Copy link

jleprinc commented May 2, 2024

I need to update the version of mixpanel-react-native and so the mixpanel-swift package to 4.2.5 to have the privacy manifest but when i do so I have a crash when starting the app:

Crashed: com.mixpanel.instance.manager.instance
0  libswiftCore.dylib             0x390994 swift::TargetMetadata<swift::InProcess>::getTypeContextDescriptor() const + 4
1  libswiftCore.dylib             0x3bab74 swift::SubstGenericParametersFromMetadata::SubstGenericParametersFromMetadata(swift::TargetMetadata<swift::InProcess> const*) + 36
2  libswiftCore.dylib             0x3c4630 swift_getAssociatedTypeWitnessSlowImpl(swift::MetadataRequest, swift::TargetWitnessTable<swift::InProcess>*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolRequirement<swift::InProcess> const*, swift::TargetProtocolRequirement<swift::InProcess> const*) + 328
3  libswiftCore.dylib             0x3c26d4 swift_getAssociatedTypeWitness + 92
4  libswiftCore.dylib             0x195734 OptionSet<>.init() + 80
5  macadam                        0xf989c8 protocol witness for SetAlgebra.init() in conformance NSJSONReadingOptions + 52 (<compiler-generated>:52)
6  macadam                        0x14db168 protocol witness for SetAlgebra.init() in conformance NSJSONWritingOptions + 12
7  libswiftCore.dylib             0x1b3a60 SetAlgebra.init<A>(_:) + 492
8  macadam                        0x17243b4 protocol witness for SetAlgebra.init<A>(_:) in conformance NSJSONWritingOptions + 44 (<compiler-generated>:44)
9  libswiftCore.dylib             0x1b3f18 SetAlgebra<>.init(arrayLiteral:) + 164
10 macadam                        0x1722950 static JSONHandler.serializeJSONObject(_:) + 54 (JSONHandler.swift:54)
11 macadam                        0x17220a4 static JSONHandler.encodeAPIData(_:) + 16 (JSONHandler.swift:16)
12 macadam                        0x175d030 static Network.sendHttpEvent(serverURL:eventName:apiToken:distinctId:properties:updatePeople:completion:) + 144 (Network.swift:144)
13 macadam                        0x1733034 static MixpanelInstance.didDebugInit(serverURL:distinctId:libName:libVersion:) + 554 (MixpanelInstance.swift:554)
14 macadam                        0x172d718 MixpanelInstance.init(apiToken:flushInterval:name:trackAutomaticEvents:optOutTrackingByDefault:useUniqueDistinctId:superProperties:serverURL:) + 227 (MixpanelInstance.swift:227)
15 macadam                        0x172ce98 MixpanelInstance.__allocating_init(apiToken:flushInterval:name:trackAutomaticEvents:optOutTrackingByDefault:useUniqueDistinctId:superProperties:serverURL:) + 215 (MixpanelInstance.swift:215)
16 macadam                        0x17284e4 closure #1 in MixpanelManager.initialize(token:flushInterval:instanceName:trackAutomaticEvents:optOutTrackingByDefault:useUniqueDistinctId:superProperties:serverURL:) + 187 (Mixpanel.swift:187)
17 macadam                        0x172872c partial apply for closure #1 in MixpanelManager.initialize(token:flushInterval:instanceName:trackAutomaticEvents:optOutTrackingByDefault:useUniqueDistinctId:superProperties:serverURL:) + 92 (<compiler-generated>:92)
18 macadam                        0x7bbe08 thunk for @callee_guaranteed () -> () + 20 (<compiler-generated>:20)
19 macadam                        0x7bbe2c thunk for @escaping @callee_guaranteed () -> () + 24 (<compiler-generated>:24)
20 libdispatch.dylib              0x3dd4 _dispatch_client_callout
21 libdispatch.dylib              0x132c4 _dispatch_lane_barrier_sync_invoke_and_complete
22 macadam                        0x172761c MixpanelManager.initialize(token:flushInterval:instanceName:trackAutomaticEvents:optOutTrackingByDefault:useUniqueDistinctId:superProperties:serverURL:) + 181 (Mixpanel.swift:181)
23 macadam                        0x1727348 static Mixpanel.initialize(token:trackAutomaticEvents:flushInterval:instanceName:optOutTrackingByDefault:useUniqueDistinctId:superProperties:serverURL:) + 50 (Mixpanel.swift:50)
24 macadam                        0x1768f18 MixpanelReactNative.initialize(_:trackAutomaticEvents:optOutTrackingByDefault:properties:serverURL:resolver:rejecter:) + 25 (MixpanelReactNative.swift:25)
25 macadam                        0x17690d0 @objc MixpanelReactNative.initialize(_:trackAutomaticEvents:optOutTrackingByDefault:properties:serverURL:resolver:rejecter:) + 320 (<compiler-generated>:320)
26 CoreFoundation                 0x31c84 __invoking___ + 148
27 CoreFoundation                 0x31710 -[NSInvocation invoke] + 428
28 CoreFoundation                 0x31538 -[NSInvocation invokeWithTarget:] + 64
29 macadam                        0x1c54220 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 584 (RCTModuleMethod.mm:584)
30 macadam                        0x1c582bc facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext) + 196 (RCTNativeModule.mm:196)
31 macadam                        0x1c57a58 facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const + 113 (RCTNativeModule.mm:113)
32 macadam                        0x1c579cc invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 104 (RCTNativeModule.mm:104)
33 libdispatch.dylib              0x213c _dispatch_call_block_and_release
34 libdispatch.dylib              0x3dd4 _dispatch_client_callout
35 libdispatch.dylib              0xb400 _dispatch_lane_serial_drain
36 libdispatch.dylib              0xbf30 _dispatch_lane_invoke
37 libdispatch.dylib              0x16cb4 _dispatch_root_queue_drain_deferred_wlh
38 libdispatch.dylib              0x16528 _dispatch_workloop_worker_thread
39 libsystem_pthread.dylib        0x1f20 _pthread_wqthread + 288
40 libsystem_pthread.dylib        0x1fc0 start_wqthread + 8

The error seems to be located in the class JSONHandler at line 54, the error is not catched :

  var serializedObject: Data?
        do {
            serializedObject = try JSONSerialization
                .data(withJSONObject: serializableJSONObject, options: [])
        } catch {
            Logger.warn(message: "exception encoding api data")
        }
@zihejia
Copy link
Contributor

zihejia commented May 4, 2024

The code that caused the crash has been removed. Thanks for bringing this up. We will also update React Native.

@zihejia zihejia closed this as completed May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants