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

NewRelic + TrackedScreens DSL crashes #256

Open
timbroder opened this issue Mar 4, 2016 · 4 comments
Open

NewRelic + TrackedScreens DSL crashes #256

timbroder opened this issue Mar 4, 2016 · 4 comments

Comments

@timbroder
Copy link

I haven't dug into this fully yet, wondering if anyone here has come across this

When using both NewRelic and screen tracking via DSL, the app crashes when the first UIViewController that is being tracked is shown:

2016-03-04 09:12:02.634 KidFund[46123:6521760] *** Terminating app due to uncaught exception 'NRInvalidArgumentException', reason: 'New Relic detected an unrecognized selector, 'rac_alias_viewDidAppear:', sent to 'UIViewController'. It's possible _cmd was renamed by an unsafe method_exchangeImplementations().'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000102c34e65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001056c1deb objc_exception_throw + 48
    2   KidFund                             0x00000001018dd33b NRMA__beginMethod + 475
    3   KidFund                             0x00000001018ddaf7 NRMA__boolParamHandler + 58
    4   KidFund                             0x0000000101870dc6 -[IBGMethodSwizzler viewDidAppear:] + 327
    5   CoreFoundation                      0x0000000102b231cc __invoking___ + 140
    6   CoreFoundation                      0x0000000102b2301e -[NSInvocation invoke] + 286
    7   ReactiveCocoa                       0x0000000103a2510c RACForwardInvocation + 252
    8   ReactiveCocoa                       0x0000000103a24f6c __RACSwizzleForwardInvocation_block_invoke + 92
    9   CoreFoundation                      0x0000000102b8a727 ___forwarding___ + 487
    10  CoreFoundation                      0x0000000102b8a4b8 _CF_forwarding_prep_0 + 120
    11  UIKit                               0x0000000103ec5949 -[UIViewController _setViewAppearState:isAnimating:] + 830
    12  UIKit                               0x0000000103ec5d52 __52-[UIViewController _setViewAppearState:isAnimating:]_block_invoke + 166
    13  CoreFoundation                      0x0000000102b7670d __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 77
    14  CoreFoundation                      0x0000000102b765df -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 207
    15  UIKit                               0x0000000103ec5b31 -[UIViewController _setViewAppearState:isAnimating:] + 1318
    16  UIKit                               0x0000000103ec62cc -[UIViewController _endAppearanceTransition:] + 262
    17  UIKit                               0x0000000103f00f63 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 1290
    18  UIKit                               0x00000001041a1880 -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:] + 422
    19  UIKit                               0x00000001041a1bf6 -[UINavigationTransitionView _cleanupTransition] + 788
    20  UIKit                               0x0000000103db32af -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 241
    21  UIKit                               0x0000000103db365e -[UIViewAnimationState animationDidStop:finished:] + 80
    22  QuartzCore                          0x0000000108f3dfa0 _ZN2CA5Layer23run_animation_callbacksEPv + 308
    23  libdispatch.dylib                   0x000000010635d49b _dispatch_client_callout + 8
    24  libdispatch.dylib                   0x00000001063452af _dispatch_main_queue_callback_4CF + 1738
    25  CoreFoundation                      0x0000000102b94d09 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    26  CoreFoundation                      0x0000000102b562c9 __CFRunLoopRun + 2073
    27  CoreFoundation                      0x0000000102b55828 CFRunLoopRunSpecific + 488
    28  GraphicsServices                    0x00000001089f7ad2 GSEventRunModal + 161
    29  UIKit                               0x0000000103d29610 UIApplicationMain + 171
    30  KidFund                             0x0000000101673dad main + 109
    31  libdyld.dylib                       0x000000010639192d start + 1
    32  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Note: I'm installing NewRelic via it's own pod rather than via subspec because I run into a dynamic frameworks compatible issue

Is there any other info I can give? Thanks

@orta
Copy link
Owner

orta commented Mar 4, 2016

Yeah, I've heard others have issues with swizzling and new relic, might be worth seeing if people are having trouble with reactive cocoa and new relic - may be fixes there

@timbroder
Copy link
Author

That opened up a good amount of info thanks for the suggestion

It seems the recommended fix in this case is to use RACSubject and avoid rac_signalForSelector

If I can wrap my head around it is that an acceptable PR? I understand this is an edge case and while I'd love to use the DSL, wouldn't mind doing the screen tracking by hand

@orta
Copy link
Owner

orta commented Mar 4, 2016

You can give it a shot, but I also don't know the difference in semantics there.

@timbroder
Copy link
Author

👍

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