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

Crash NSInvalidArgumentException NRMAHTTPUtilities.mm line 222 in [NRMAHTTPUtilities generateConnectivityHeadersWithNRMAPayload:] #309

Open
vishundayal opened this issue Sep 24, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@vishundayal
Copy link

Description

#Seems NR lib trying to write invalid json
Location NRMAHTTPUtilities.mm line 222 in [NRMAHTTPUtilities generateConnectivityHeadersWithNRMAPayload:]
Exception NSInvalidArgumentException
Message Invalid type in JSON write (Foundation.JSONReference)
modelNumber iPhone16,1

@vishundayal vishundayal added the bug Something isn't working label Sep 24, 2024
@mbruin-NR
Copy link
Contributor

We have not been able to reproduce this issue but have a potential fix in the next release 7.5.2, which will come out this week or next.

@ieatfood
Copy link

ieatfood commented Sep 25, 2024

We also are seeing what we believe may be the same crash in our reports. It started when we upgraded newrelic ios agent from 7.4.10 to 7.4.12.

The stack trace is a little different, I'll post here in case it helps. Please let me know if this is not, in fact, the same issue.

EXC_BAD_ACCESS: Attempted to dereference garbage pointer 0x100000000.

0  libobjc.A.dylib +0x3c38         _objc_msgSend
1  NewRelic +0x888c                -[NRMAPayload initWithTimestamp:accountID:appID:traceID:parentID:trustedAccountKey:] (NRMAPayload.m:24)
2  NewRelic +0x71a94               +[NRMAHTTPUtilities startTrip] (NRMAHTTPUtilities.mm:204:33)
3  NewRelic +0x711ec               +[NRMAHTTPUtilities addConnectivityHeaderNRMAPayload:] (NRMAHTTPUtilities.mm:96:28)
4  NewRelic +0x3fe80               NRMAOverride__dataTaskWithRequest (NRMAURLSessionOverride.m:222:38)
5  OurApp +0x95d264               -[RCTHTTPRequestHandler sendRequest:withDelegate:] (RCTHTTPRequestHandler.mm:103:32)
6  OurApp +0x962718               -[RCTNetworkTask start] (RCTNetworkTask.mm:75:16)
7  OurApp +0x960aac               -[RCTNetworking sendRequest:responseType:incrementalUpdates:responseSender:] (RCTNetworking.mm:652:3)
8  OurApp +0x961ee4               __38-[RCTNetworking sendRequest:callback:]_block_invoke (RCTNetworking.mm:721:9)
9  libdispatch.dylib +0x2138       __dispatch_call_block_and_release
10 libdispatch.dylib +0x3dd0       __dispatch_client_callout
11 libdispatch.dylib +0xb3fc       __dispatch_lane_serial_drain
12 libdispatch.dylib +0xbf2c       __dispatch_lane_invoke
13 libdispatch.dylib +0x16cb0      __dispatch_root_queue_drain_deferred_wlh
14 libdispatch.dylib +0x16524      __dispatch_workloop_worker_thread
15 libsystem_pthread.dylib +0x4930 __pthread_wqthread

@mbruin-NR
Copy link
Contributor

Agent 7.5.2 has been released. This crash might have the same root cause, but without reproducing it with debug tools it's difficult to know for sure. This area (NRMAHTTPUtilities startTrip) of the code is one where some changes to fix the crash occurred.
Let me know if agent 7.5.2 has an affect on either of the crashes.

@adrianv-synergy
Copy link

This is still not good with 7.5.2.
We are getting it from a ReactNative app, with a podfile.lock:

  • newrelic-react-native-agent (1.4.7):
    • NewRelicAgent (~> 7.5.2)
    • React
  • NewRelicAgent (7.5.2)

Location: NRMAHTTPUtilities.mm line 222 in [NRMAHTTPUtilities generateConnectivityHeadersWithNRMAPayload:]
Exception: NSInvalidArgumentException
Message :Invalid type in JSON write (__NSCFSet)

NRMAHTTPUtilities.mm line 222 in +[NRMAHTTPUtilities generateConnectivityHeadersWithNRMAPayload:] (NRMAHTTPUtilities.mm:222) NRMAHTTPUtilities.mm line 99 in +[NRMAHTTPUtilities addConnectivityHeaderNRMAPayload:] (NRMAHTTPUtilities.mm:99) NRMAURLSessionOverride.m line 268 in NRMAOverride__dataTaskWithRequest_completionHandler (NRMAURLSessionOverride.m:268)

@mbruin-NR mbruin-NR reopened this Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants