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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in iOS #105

Open
saghul opened this issue Dec 9, 2021 · 7 comments
Open

Crash in iOS #105

saghul opened this issue Dec 9, 2021 · 7 comments

Comments

@saghul
Copy link

saghul commented Dec 9, 2021

Hey there! 馃憢 Long time users, first time crash reporters!

We use this package in Jitsi Meet and on our latest release (which uses version 2.3.3 of this package) I'm seeing the following crash in Crashlytics:

Crashed: com.facebook.react.AmplitudeReactNativeQueue
0  libobjc.A.dylib                0x25c80 objc_retain + 16
1  libswiftFoundation.dylib       0x22f4 static String._unconditionallyBridgeFromObjectiveC(_:) + 28
2  JitsiMeetSDK                   0x601dd0 specialized ReactNative.getDeviceId(_:resolver:rejecter:) + 56 (AmplitudeReactNative.swift:56)
3  JitsiMeetSDK                   0x6008dc @objc ReactNative.getDeviceId(_:resolver:rejecter:) + 7028 (<compiler-generated>:7028)
4  CoreFoundation                 0x12e724 __invoking___ + 148
5  CoreFoundation                 0x1d04 -[NSInvocation invoke] + 380
6  CoreFoundation                 0x2308 -[NSInvocation invokeWithTarget:] + 80
7  JitsiMeetSDK                   0x54bf60 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 572 (RCTModuleMethod.mm:572)
8  JitsiMeetSDK                   0x54e10c facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&) + 108 (RCTNativeModule.mm:108)
9  JitsiMeetSDK                   0x54de7c invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 365 (Optional.h:365)
10 libdispatch.dylib              0x2a84 _dispatch_call_block_and_release + 32
11 libdispatch.dylib              0x481c _dispatch_client_callout + 20
12 libdispatch.dylib              0xc004 _dispatch_lane_serial_drain + 620
13 libdispatch.dylib              0xcc00 _dispatch_lane_invoke + 404
14 libdispatch.dylib              0x174bc _dispatch_workloop_worker_thread + 764
15 libsystem_pthread.dylib        0x37a4 _pthread_wqthread + 276
16 libsystem_pthread.dylib        0xa74c start_wqthread + 8

Does it ring a bell? I checked the changelog for all further versions, but there is no mention of a fix for this crash AFAICT.

@justin-fiedler
Copy link
Contributor

Hi @saghul thanks for reaching out. We are looking into this and will get back to you later today with an update.

@justin-fiedler
Copy link
Contributor

justin-fiedler commented Dec 10, 2021

Hi @saghul we have not been able to reproduce the error on our end.

Following the steps below worked correctly for me both for 2.3.3 and the latest 2.6.0

import * as React from 'react';
import { Button } from 'react-native';
import { Amplitude, Identify } from '@amplitude/react-native';

const amp = Amplitude.getInstance();
amp.init(API_KEY);
amp.setUserId('amp-rn-user-id');
amp.setDeviceId('amp-rn-device-id');

export function MyApp() {
  return (
    <>
      <Button  title="Log Event" onPress={() => amp.logEvent('BUTTON_CLICKED')} />
      <Button title="Set device id" onPress={() => amp.setDeviceId('amp-rn-device-id-from-button')}/>
    </>
  );
}

Could you try following the same steps and see if they work for you to help determine is this is an environment issue?

If that doesn't work could you please try to provide more information with steps to reproduce?

Thanks!

Env:

  • XCode 13.1
  • Cocoapods 1.11.1
  • (amplitude-react-native 2.3.3 & Amplitude 8.2.0) | (amplitude-react-native 2.6.0 & Amplitude 8.5.0)

@saghul
Copy link
Author

saghul commented Dec 10, 2021

Will do!

@justin-fiedler justin-fiedler self-assigned this Dec 10, 2021
@justin-fiedler
Copy link
Contributor

Hi @saghul checking in to see if you were able to get things working on your end. Thanks!

@saghul
Copy link
Author

saghul commented Jan 5, 2022

I have not been able to reproduce this in a synthetic test, but we have gotten some ~150 crashes with similar tracebacks:

Crashed: com.facebook.react.AmplitudeReactNativeQueue
0  libobjc.A.dylib                0x1540 objc_msgSend + 32
1  libswiftCore.dylib             0x1eddd0 _bridgeCocoaString(_:) + 88
2  libswiftCore.dylib             0x1edfc0 String.init(_cocoaString:) + 28
3  libswiftFoundation.dylib       0x32ac static String._unconditionallyBridgeFromObjectiveC(_:) + 36
4  JitsiMeetSDK                   0x6059d8 specialized ReactNative.getDeviceId(_:resolver:rejecter:) + 56 (AmplitudeReactNative.swift:56)
5  JitsiMeetSDK                   0x6044e4 @objc ReactNative.getDeviceId(_:resolver:rejecter:) + 7028 (<compiler-generated>:7028)
6  CoreFoundation                 0x223a4 __invoking___ + 148
7  CoreFoundation                 0x3fb74 -[NSInvocation invoke] + 468
8  CoreFoundation                 0x769d4 -[NSInvocation invokeWithTarget:] + 80
9  JitsiMeetSDK                   0x54fb68 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 572 (RCTModuleMethod.mm:572)
10 JitsiMeetSDK                   0x551d14 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&) + 108 (RCTNativeModule.mm:108)
11 JitsiMeetSDK                   0x551a84 invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 365 (Optional.h:365)
12 libdispatch.dylib              0x2924 _dispatch_call_block_and_release + 32
13 libdispatch.dylib              0x4670 _dispatch_client_callout + 20
14 libdispatch.dylib              0xbdf4 _dispatch_lane_serial_drain + 672
15 libdispatch.dylib              0xc968 _dispatch_lane_invoke + 392
16 libdispatch.dylib              0x171b8 _dispatch_workloop_worker_thread + 656
17 libsystem_pthread.dylib        0x10f4 _pthread_wqthread + 288
18 libsystem_pthread.dylib        0xe94 start_wqthread + 8
Crashed: com.facebook.react.AmplitudeReactNativeQueue
0  CoreFoundation                 0x1a36d8 _CFRelease.cold.3 + 92
1  CoreFoundation                 0x14d0c _CFRelease + 1508
2  libswiftCore.dylib             0x1ede50 _bridgeCocoaString(_:) + 328
3  libswiftCore.dylib             0x1edf50 String.init(_cocoaString:) + 28
4  libswiftFoundation.dylib       0x3e74 static String._unconditionallyBridgeFromObjectiveC(_:) + 36
5  JitsiMeetSDK                   0x6059d8 specialized ReactNative.getDeviceId(_:resolver:rejecter:) + 56 (AmplitudeReactNative.swift:56)
6  JitsiMeetSDK                   0x6044e4 @objc ReactNative.getDeviceId(_:resolver:rejecter:) + 7028 (<compiler-generated>:7028)
7  CoreFoundation                 0x222f4 __invoking___ + 148
8  CoreFoundation                 0x3fac4 -[NSInvocation invoke] + 468
9  CoreFoundation                 0x76924 -[NSInvocation invokeWithTarget:] + 80
10 JitsiMeetSDK                   0x54fb68 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 572 (RCTModuleMethod.mm:572)
11 JitsiMeetSDK                   0x551d14 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&) + 108 (RCTNativeModule.mm:108)
12 JitsiMeetSDK                   0x551a84 invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 365 (Optional.h:365)
13 libdispatch.dylib              0x2914 _dispatch_call_block_and_release + 32
14 libdispatch.dylib              0x4660 _dispatch_client_callout + 20
15 libdispatch.dylib              0xbde4 _dispatch_lane_serial_drain + 672
16 libdispatch.dylib              0xc958 _dispatch_lane_invoke + 392
17 libdispatch.dylib              0x171a8 _dispatch_workloop_worker_thread + 656
18 libsystem_pthread.dylib        0x10f4 _pthread_wqthread + 288
19 libsystem_pthread.dylib        0xe94 start_wqthread + 8
Crashed: com.facebook.react.AmplitudeReactNativeQueue
0  libobjc.A.dylib                0x3490 objc_retain + 16
1  libswiftFoundation.dylib       0x3e6c static String._unconditionallyBridgeFromObjectiveC(_:) + 28
2  JitsiMeetSDK                   0x6059d8 specialized ReactNative.getDeviceId(_:resolver:rejecter:) + 56 (AmplitudeReactNative.swift:56)
3  JitsiMeetSDK                   0x6044e4 @objc ReactNative.getDeviceId(_:resolver:rejecter:) + 7028 (<compiler-generated>:7028)
4  CoreFoundation                 0x222f4 __invoking___ + 148
5  CoreFoundation                 0x3fac4 -[NSInvocation invoke] + 468
6  CoreFoundation                 0x76924 -[NSInvocation invokeWithTarget:] + 80
7  JitsiMeetSDK                   0x54fb68 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 572 (RCTModuleMethod.mm:572)
8  JitsiMeetSDK                   0x551d14 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&) + 108 (RCTNativeModule.mm:108)
9  JitsiMeetSDK                   0x551a84 invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 365 (Optional.h:365)
10 libdispatch.dylib              0x2914 _dispatch_call_block_and_release + 32
11 libdispatch.dylib              0x4660 _dispatch_client_callout + 20
12 libdispatch.dylib              0xbde4 _dispatch_lane_serial_drain + 672
13 libdispatch.dylib              0xc958 _dispatch_lane_invoke + 392
14 libdispatch.dylib              0x171a8 _dispatch_workloop_worker_thread + 656
15 libsystem_pthread.dylib        0x10f4 _pthread_wqthread + 288
16 libsystem_pthread.dylib        0xe94 start_wqthread + 8

Out of all crashes 64% were on iOS 15 and 4% in the background.

@justin-fiedler
Copy link
Contributor

Thanks @saghul. I added a ticket in our backlog for now. Please let me know if you can recreate consistently and we will investigate further.

@justin-fiedler justin-fiedler removed their assignment Jan 21, 2022
@saghul
Copy link
Author

saghul commented Mar 3, 2022

Quick update, we keep getting these and it has become our topmost crash 馃槩

Screenshot 2022-03-03 at 10 49 29

We just started rolling out a new app version with RN 0.66, let's hope it'd ok with that one.

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