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

NSInvalidArgumentException -[NSNull allKeys]: unrecognized selector sent to instance 0x1f005b678 #4748

Open
LeeyYun opened this issue Jan 23, 2025 · 2 comments

Comments

@LeeyYun
Copy link

LeeyYun commented Jan 23, 2025

Platform

iOS

Environment

Production

Installed

CocoaPods

Version

8.41.0

Xcode Version

16.0

Did it work on previous versions?

No response

Steps to Reproduce

CoreFoundation
+0x02d5ec
<redacted>
libobjc.A
+0x031244
objc_exception_throw
CoreFoundation
+0x186174
<redacted>
CoreFoundation
+0x0305b8
<redacted>
CoreFoundation
+0x02fee0
_CF_forwarding_prep_0
appName
+0xd6ec14
sentry_sanitize (SentryNSDictionarySanitize.m:12)
In App
appName
+0xd1f4d4
-[SentryBreadcrumb serialize] (SentryBreadcrumb.m:77)
appName
+0xd52678
-[SentryEvent serializeBreadcrumbs] (SentryEvent.m:175)
appName
+0xd522c0
-[SentryEvent addSimpleProperties:] (SentryEvent.m:139)
appName
+0xd519a8
-[SentryEvent serialize] (SentryEvent.m:69)
appName
+0xd4f204
-[SentryEnvelopeItem initWithEvent:] (SentryEnvelope.m:72)
appName
+0xda1878
-[SentryTransportAdapter buildEnvelopeItems:attachments:] (SentryTransportAdapter.m:140)
appName
+0xda0f14
-[SentryTransportAdapter sendEvent:traceContext:attachments:additionalEnvelopeItems:] (SentryTransportAdapter.m:52)
appName
+0xd23b90
-[SentryClient sendEvent:withScope:alwaysAttachStacktrace:isCrashEvent:additionalEnvelopeItems:] (SentryClient.m:468)
appName
+0xd5f954
-[SentryHub captureEvent:withScope:additionalEnvelopeItems:] (SentryHub.m:325)
appName
+0xd86eac
+[SentrySDK captureEvent:withScope:] (SentrySDK.m:291)
appName
+0xd86d38
+[SentrySDK captureEvent:] (SentrySDK.m:279)
appName
+0xd19c08
-[SentryANRTrackingIntegration anrDetectedWithType:] (SentryANRTrackingIntegration.m:134)
appName
+0xd190fc
-[SentryANRTrackerV2 ANRDetected:] (SentryANRTrackerV2.m:204)
appName
+0xd18e1c
-[SentryANRTrackerV2 detectANRs] (SentryANRTrackerV2.m:176)
Foundation
+0x115a54
<redacted>
libsystem_pthread
+0x0017d0
_pthread_start
libsystem_pthread
+0x001480
thread_start

When the program starts, it detects ARN and is highly likely to encounter the aforementioned crash.

Expected Result

no crash

Actual Result

crash

Are you willing to submit a PR?

No response

@philprime
Copy link
Contributor

philprime commented Jan 23, 2025

Hi @LeeyYun, thanks for reporting this issue.

@philipphofmann it looks like an edgecase of sentry_sanitize(NSDictionary *_Nullable dictionary) where it isn't nil, but set to [NSNull null].

NSDictionary *_Nullable sentry_sanitize(NSDictionary *_Nullable dictionary)
{
if (dictionary == nil) {
return nil;
}

I would propose we add another null check in the method, but before that we might want to understand how that could even happen.

@philprime philprime moved this from Needs Discussion to Needs Investigation in Mobile & Cross Platform SDK Jan 23, 2025
@philprime philprime moved this from Needs Investigation to Needs Discussion in Mobile & Cross Platform SDK Jan 23, 2025
@philipphofmann
Copy link
Member

@philprime, good catch. That could be the culprit. If you can reproduce this with a test, please open an PR.

@philprime philprime self-assigned this Jan 23, 2025
@philprime philprime moved this from Needs Discussion to Needs Investigation in Mobile & Cross Platform SDK Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Investigation
Development

No branches or pull requests

3 participants