Raygun 4 iOS Crashing on identify user

nhart12

Posted on
Nov 17 2016

I have been getting an exception occasionally when calling the identify user function. It seems to be affecting even the newest version 2.3.0. I'm testing on latest xCode 8 and iOS 10 I call the identify function after a user logs into my app, I normally can replicate it by logging out, and logging back in and occasionally get an error. I'm using it like below:

        if let user = user{
            let userInfo = RaygunUserInfo(identifier: user.userId)
            userInfo.firstName = user.firstName
            userInfo.fullName = user.firstName + " " + user.lastName
            Raygun.sharedReporter().identifyWithUserInfo(userInfo)
        }

The stacktrace in Raygun has this at the top:

0   libobjc.A.dylib    0x00000001812f9b90 objc_msgSend + 16 
1   MyProject            0x0000000100bcc8ec plcrash_log_writer_set_user_info

Below is the stackTrace I get when its crashing in xCode.

 0    0x00000001888c6014 in __pthread_kill ()
 1    0x000000018898e450 in pthread_kill ()
 2    0x000000018883a3e0 in abort ()
 3    0x0000000100f2cb28 in uncaught_exception_handler ()
 4    0x00000001898f6540 in __handleUncaughtException ()
 5    0x0000000188330838 in _objc_terminate() ()
 6    0x000000018831f66c in std::__terminate(void (*)()) ()
 7    0x000000018831ef84 in __cxa_throw ()
 8    0x0000000188330690 in objc_exception_throw ()
 9    0x00000001897dac3c in -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] ()
10    0x00000001897daaac in +[NSDictionary dictionaryWithObjects:forKeys:count:] ()
11    0x0000000100f1e2a8 in +[Pulse sendPulseEvent:] ()
12    0x0000000100f1dc24 in -[Pulse identifyWithUserInfo:] ()

Deleted User

Raygun

Posted on
Nov 17 2016

Hi,

Thank you for letting us know. We will begin finding a fix for this first thing next week. Please let us know if you find any more issues or have any more questions.

Regards, Mitchell.


Deleted User

Raygun

Posted on
Nov 25 2016

Hello again,

We have identified an issue relating to setting user information and we will release a fix next week. Thank you for your patience.

Regards, Mitchell.


Deleted User

Raygun

Posted on
Nov 30 2016

Hi,

We have released an update to our Raygun4iOS provider. You can find it here.

After investigating further we can see there possibly being two problems occurring. One relating to how we handle our concept of sessions which change when there is a change in user, which the new provider release fixes. The other issue relates to the first stack trace you supplied showing a crash in plcrash_log_writer_set_user_info. We think this may a threading issue where the user information used by the crash reporter has already been released resulting in an application crash. Please update to see if the issues you are experiencing are resolved. If the issues continue please let us know and provide us with any more information you can.

Thank you, Mitchell.


Richard Cordero

Posted on
Nov 30 2016

Hello Mitchell

I've tested the new update (2.3.2) and I'm still encountering the crash. It occurs with the same steps as before. Calling setUserInfo twice. Full stack trace below.

* thread #1: tid = 0x1982aa, 0x0000000106513acb libobjc.A.dylib`objc_msgSend + 11, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x0000000106513acb libobjc.A.dylib`objc_msgSend + 11
    frame #1: 0x0000000102cb0178 CoreFoundation`-[__NSCFString isEqualToString:] + 56
    frame #2: 0x00000001018460c1 PDS iPad`-[Pulse identifyWithUserInfo:] + 273
  * frame #3: 0x0000000101739872 PDS iPad`+[RaygunController setUserInfo:](self=RaygunController, _cmd="setUserInfo:", userInfo=3 key/value pairs) + 370 at RaygunController.m:32
    frame #4: 0x00000001015fb880 PDS iPad`-[LoginViewController performLogin:](self=0x00007f92b240a4f0, _cmd="performLogin:", sender=0x00007f92b260e1e0) + 1072 at LoginViewController.m:255
    frame #5: 0x0000000104ca25b8 UIKit`-[UIApplication sendAction:to:from:forEvent:] + 83
    frame #6: 0x0000000104e27edd UIKit`-[UIControl sendAction:to:forEvent:] + 67
    frame #7: 0x0000000104e281f6 UIKit`-[UIControl _sendActionsForEvents:withEvent:] + 444
    frame #8: 0x0000000104e270f2 UIKit`-[UIControl touchesEnded:withEvent:] + 668
    frame #9: 0x0000000104d0fce1 UIKit`-[UIWindow _sendTouchesForEvent:] + 2747
    frame #10: 0x0000000104d113cf UIKit`-[UIWindow sendEvent:] + 4011
    frame #11: 0x0000000104cbe63f UIKit`-[UIApplication sendEvent:] + 371
    frame #12: 0x00000001054b071d UIKit`__dispatchPreprocessedEventFromEventQueue + 3248
    frame #13: 0x00000001054a93c7 UIKit`__handleEventQueue + 4879
    frame #14: 0x0000000102cf3311 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame #15: 0x0000000102cd859c CoreFoundation`__CFRunLoopDoSources0 + 556
    frame #16: 0x0000000102cd7a86 CoreFoundation`__CFRunLoopRun + 918
    frame #17: 0x0000000102cd7494 CoreFoundation`CFRunLoopRunSpecific + 420
    frame #18: 0x0000000109994a6f GraphicsServices`GSEventRunModal + 161
    frame #19: 0x0000000104ca0964 UIKit`UIApplicationMain + 159
    frame #20: 0x00000001015b77cf PDS iPad`main(argc=1, argv=0x00007fff5e6957c0) + 111 at main.m:14
    frame #21: 0x000000010706a68d libdyld.dylib`start + 1

nhart12

Posted on
Dec 01 2016

Hello Mitchell

Thanks for the fast turn around on a potential fix. Unfortunately I have replicated Richard's crash as well. My stack trace looks very similar.

#0  0x0000000188342f30 in objc_msgSend ()
#1  0x00000001897d5b70 in -[__NSCFString isEqualToString:] ()
#2  0x0000000100e61b60 in -[Pulse identifyWithUserInfo:] ()

Deleted User

Raygun

Posted on
Dec 01 2016

Hi,

Thank you for the additional information. I was able to replicate the issue in a Swift project when setting the user information. The problem was coming from how we were copying and holding onto that information. I have resolved the issue and released a new update (v2.3.3) to the provider, which can be found here. Please update and let me know if this resolves the issues you are experiencing. Thank you for your patience while we sort this out.

Regards, Mitchell.


nhart12

Posted on
Dec 02 2016

Hi Mitchell, The new version appears to have fixed the crash. Thanks!


Reply