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

[Bug]: Crash in OneSignal iOS SDK 5.2.6: NSInvalidArgumentException During NSDictionary Initialization #1527

Closed
1 task done
ashleydee1999 opened this issue Dec 16, 2024 · 5 comments

Comments

@ashleydee1999
Copy link

ashleydee1999 commented Dec 16, 2024

What happened?

The app crashes with a NSInvalidArgumentException when attempting to initialize an NSDictionary. This issue seems to originate from the OneSignal SDK during the handling of network requests. The specific stack trace points to methods in OneSignalCore and getInAppMessagesFromServer in the OneSignalInAppMessages module.

Steps to reproduce?

Based on the crashlytics and frequency of crashes, I can say these are the basic steps

1. Integrate the OneSignal SDK version 5.2.6 into an iOS application.
2. Perform a task that triggers in-app messaging or network communication via the SDK (e.g., fetching messages from the server or sending an analytics event).

What did you expect to happen?

The app should handle the network request or in-app messaging process without crashing. If invalid data is encountered, it should gracefully fail and log an error instead of throwing an exception.

OneSignal iOS SDK version

5.2.6

iOS version

17

Specific iOS version

* iOS 18.2.0

Relevant log output

# Crashlytics - Stack trace
# Application: com.yuno.app
# Platform: apple
# Version: 2.3 (757)
# Issue: 9d468a33640efc4ce9fa4f63b2835353
# Session: d00287e31cfb4515bb5ba3fb647a195f_DNE_0_v2
# Date: Thu Dec 12 2024 12:15:46 GMT+0200 (South Africa Standard Time)

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x2d5ec __exceptionPreprocess
1  libobjc.A.dylib                0x31244 objc_exception_throw
2  CoreFoundation                 0x41398 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]
3  CoreFoundation                 0x40734 +[NSDictionary dictionaryWithObjects:forKeys:count:]
4  OneSignalCore                  0xa06c (Missing UUID 1441ee4d836e389692f4c94c829026c3)
5  OneSignalCore                  0x9338 (Missing UUID 1441ee4d836e389692f4c94c829026c3)
6  Yuno                           0x89da08 __InstrumentDataTaskWithRequestCompletionHandler_block_invoke_2 + 306 (FPRNSURLSessionInstrument.m:306)
7  Yuno                           0x89da08 __InstrumentDataTaskWithRequestCompletionHandler_block_invoke_2 + 306 (FPRNSURLSessionInstrument.m:306)
8  CFNetwork                      0x3fbcc __40-[__NSURLSessionLocal taskForClassInfo:]_block_invoke
9  CFNetwork                      0x3f988 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke_2
10 libdispatch.dylib              0x2248 _dispatch_call_block_and_release
11 libdispatch.dylib              0x3fa8 _dispatch_client_callout
12 libdispatch.dylib              0xb5cc _dispatch_lane_serial_drain
13 libdispatch.dylib              0xc158 _dispatch_lane_invoke
14 libdispatch.dylib              0x1738c _dispatch_root_queue_drain_deferred_wlh
15 libdispatch.dylib              0x16bd8 _dispatch_workloop_worker_thread
16 libsystem_pthread.dylib        0x3680 _pthread_wqthread
17 libsystem_pthread.dylib        0x1474 start_wqthread

com.apple.main-thread
0  AttributeGraph                 0x486c AGGraphSetOutputValue + 476
1  SwiftUICore                    0x1e9dc closure #1 in StatefulRule.value.setter + 72
2  SwiftUICore                    0x1e98c partial apply for closure #1 in StatefulRule.value.setter + 24
3  SwiftUICore                    0x1de88 withUnsafePointer<A, B, C>(to:_:) + 160
4  SwiftUICore                    0x470d8 closure #1 in closure #1 in UnwrapConditional.updateValue() + 384
5  SwiftUICore                    0x46414 ConditionalTypeDescriptor.project(at:baseIndex:_:) + 228
6  SwiftUICore                    0x4675c closure #2 in ConditionalTypeDescriptor.project(at:baseIndex:_:) + 136
7  SwiftUICore                    0x464c4 ConditionalTypeDescriptor.project(at:baseIndex:_:) + 404
8  SwiftUICore                    0x20b68 closure #1 in UnwrapConditional.updateValue() + 132
9  SwiftUICore                    0x20adc partial apply for closure #1 in UnwrapConditional.updateValue() + 32
10 SwiftUICore                    0x1de88 withUnsafePointer<A, B, C>(to:_:) + 160
11 SwiftUICore                    0x6840c UnwrapConditional.updateValue() + 296
12 SwiftUICore                    0x63c58 partial apply for implicit closure #1 in closure #1 in closure #1 in Attribute.init<A>(_:) + 32
13 AttributeGraph                 0xccac AG::Graph::UpdateStack::update() + 540
14 AttributeGraph                 0xc870 AG::Graph::update_attribute(AG::data::ptr<AG::Node>, unsigned int) + 424
15 AttributeGraph                 0xc444 AG::Subgraph::update(unsigned int) + 848
16 SwiftUICore                    0x8046c ViewGraph.updateOutputs(async:) + 348
17 SwiftUICore                    0x7fa9c closure #2 in closure #1 in ViewRendererHost.render(interval:updateDisplayList:targetTimestamp:) + 152
18 SwiftUICore                    0x7f578 closure #1 in ViewRendererHost.render(interval:updateDisplayList:targetTimestamp:) + 708
19 SwiftUICore                    0x7f26c ViewRendererHost.render(interval:updateDisplayList:targetTimestamp:) + 556
20 SwiftUI                        0x7fd0 UIHostingViewBase.layoutSubviews() + 324
21 SwiftUI                        0x7e74 _UIHostingView.layoutSubviews() + 120
22 SwiftUI                        0x7dd8 @objc _UIHostingView.layoutSubviews() + 36
23 UIKitCore                      0x377f8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2424
24 QuartzCore                     0x90c30 CA::Layer::layout_if_needed(CA::Transaction*) + 496
25 QuartzCore                     0x907bc CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148
26 QuartzCore                     0xe589c CA::Context::commit_transaction(CA::Transaction*, double, double*) + 472
27 QuartzCore                     0x5c56c CA::Transaction::commit() + 648
28 UIKitCore                      0x1c4730 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 36
29 CoreFoundation                 0x79d80 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
30 CoreFoundation                 0x76680 __CFRunLoopDoBlocks + 356
31 CoreFoundation                 0x75d44 __CFRunLoopRun + 864
32 CoreFoundation                 0xc8274 CFRunLoopRunSpecific + 588
33 GraphicsServices               0x14c0 GSEventRunModal + 164
34 UIKitCore                      0x3ee77c -[UIApplication _run] + 816
35 UIKitCore                      0x14e64 UIApplicationMain + 340
36 SwiftUI                        0x292660 closure #1 in KitRendererCommon(_:) + 168
37 SwiftUI                        0x292590 runApp<A>(_:) + 100
38 SwiftUI                        0x292474 static App.main() + 180
39 Yuno                           0x7229c static BillPayApp.$main() + 4307493532 (<compiler-generated>:4307493532)
40 Yuno                           0x729d4 main + 17 (BillPayApp.swift:17)
41 ???                            0x1ad344de8 (Missing)

com.apple.root.default-qos
0  libsystem_kernel.dylib         0x1704 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4544 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bf8 _dispatch_semaphore_wait_slow + 132
3  OneSignalOSCore                0x9cf8 __swift_instantiateGenericMetadata + 2668
4  OneSignalOSCore                0xa088 __swift_instantiateGenericMetadata + 3580
5  OneSignalInAppMessages         0xb2f4 __52-[OSMessagingController getInAppMessagesFromServer:]_block_invoke + 188
6  libdispatch.dylib              0x2248 _dispatch_call_block_and_release + 32
7  libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
8  libdispatch.dylib              0x70f4 _dispatch_queue_override_invoke + 916
9  libdispatch.dylib              0x15ec0 _dispatch_root_queue_drain + 392
10 libdispatch.dylib              0x166c4 _dispatch_worker_thread2 + 156
11 libsystem_pthread.dylib        0x3644 _pthread_wqthread + 228
12 libsystem_pthread.dylib        0x1474 start_wqthread + 8

com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x1788 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4e98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4db0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4bfc mach_msg + 24
4  CoreFoundation                 0x767f4 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x75ea0 __CFRunLoopRun + 1212
6  CoreFoundation                 0xc8274 CFRunLoopRunSpecific + 588
7  Foundation                     0x29b48 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8  Foundation                     0x1866f4 -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
9  UIKitCore                      0x481b80 -[UIEventFetcher threadMain] + 420
10 Foundation                     0x115a54 __NSThread__start__ + 724
11 libsystem_pthread.dylib        0x17d0 _pthread_start + 136
12 libsystem_pthread.dylib        0x1480 thread_start + 8

com.google.firebase.crashlytics.MachExceptionServer
0  libsystem_kernel.dylib         0x1788 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4e98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4db0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4bfc mach_msg + 24
4  Yuno                           0x843834 FIRCLSMachExceptionServer + 196 (FIRCLSMachException.c:196)
5  libsystem_pthread.dylib        0x17d0 _pthread_start + 136
6  libsystem_pthread.dylib        0x1480 thread_start + 8

com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x1788 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4e98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4db0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4bfc mach_msg + 24
4  CoreFoundation                 0x767f4 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x75ea0 __CFRunLoopRun + 1212
6  CoreFoundation                 0xc8274 CFRunLoopRunSpecific + 588
7  CFNetwork                      0xf2020 +[__CFN_CoreSchedulingSetRunnable _run:] + 416
8  Foundation                     0x115a54 __NSThread__start__ + 724
9  libsystem_pthread.dylib        0x17d0 _pthread_start + 136
10 libsystem_pthread.dylib        0x1480 thread_start + 8

com.apple.dnssd.client
0  libsystem_kernel.dylib         0x14e4 kevent_id + 8
1  libdispatch.dylib              0x26b40 _dispatch_kq_poll + 228
2  libdispatch.dylib              0x266b0 _dispatch_kq_drain + 260
3  libdispatch.dylib              0x25b00 _dispatch_kq_unote_update + 308
4  libdispatch.dylib              0x23688 _dispatch_mach_reply_kevent_register + 512
5  libdispatch.dylib              0x22f28 _dispatch_mach_msg_send + 1184
6  libdispatch.dylib              0x22618 _dispatch_mach_send_drain + 304
7  libdispatch.dylib              0x1eb94 _dispatch_mach_send_msg + 352
8  libdispatch.dylib              0x1f3dc dispatch_mach_send_with_result_and_async_reply_4libxpc + 116
9  libxpc.dylib                   0xf948 _xpc_connection_enqueue + 156
10 libxpc.dylib                   0x107c4 xpc_connection_send_message_with_reply + 264
11 libdns_services.dylib          0x1dd4 __dnssd_getaddrinfo_invalidate_block_invoke + 248
12 libdispatch.dylib              0x2248 _dispatch_call_block_and_release + 32
13 libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
14 libdispatch.dylib              0xb5cc _dispatch_lane_serial_drain + 768
15 libdispatch.dylib              0xc124 _dispatch_lane_invoke + 380
16 libdispatch.dylib              0x1738c _dispatch_root_queue_drain_deferred_wlh + 288
17 libdispatch.dylib              0x16bd8 _dispatch_workloop_worker_thread + 540
18 libsystem_pthread.dylib        0x3680 _pthread_wqthread + 288
19 libsystem_pthread.dylib        0x1474 start_wqthread + 8

Thread
0  libsystem_pthread.dylib        0x146c start_wqthread + 10

Crashed: com.google.firebase.crashlytics.ios.exception
0  Yuno                           0x834d0c FIRCLSProcessRecordAllThreads + 392 (FIRCLSProcess.c:392)
1  Yuno                           0x8350ec FIRCLSProcessRecordAllThreads + 423 (FIRCLSProcess.c:423)
2  Yuno                           0x843270 FIRCLSHandler + 34 (FIRCLSHandler.m:34)
3  Yuno                           0x843074 __FIRCLSExceptionRecord_block_invoke + 240 (FIRCLSException.mm:240)
4  libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
5  libdispatch.dylib              0x137fc _dispatch_lane_barrier_sync_invoke_and_complete + 56
6  Yuno                           0x841ff0 FIRCLSExceptionRecord + 242 (FIRCLSException.mm:242)
7  Yuno                           0x842b38 FIRCLSExceptionRecordNSException + 126 (FIRCLSException.mm:126)
8  Yuno                           0x841bf8 FIRCLSTerminateHandler() + 407 (FIRCLSException.mm:407)
9  libc++abi.dylib                0x1287c std::__terminate(void (*)()) + 16
10 libc++abi.dylib                0x12820 std::terminate() + 108
11 libobjc.A.dylib                0x3f9d8 objc_terminate + 16
12 libdispatch.dylib              0x3fbc _dispatch_client_callout + 40
13 libdispatch.dylib              0xb5cc _dispatch_lane_serial_drain + 768
14 libdispatch.dylib              0xc158 _dispatch_lane_invoke + 432
15 libdispatch.dylib              0x1738c _dispatch_root_queue_drain_deferred_wlh + 288
16 libdispatch.dylib              0x16bd8 _dispatch_workloop_worker_thread + 540
17 libsystem_pthread.dylib        0x3680 _pthread_wqthread + 288
18 libsystem_pthread.dylib        0x1474 start_wqthread + 8

com.apple.root.default-qos
0  libsystem_kernel.dylib         0x1704 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4544 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bf8 _dispatch_semaphore_wait_slow + 132
3  OneSignalOSCore                0x9cf8 __swift_instantiateGenericMetadata + 2668
4  OneSignalOSCore                0xa088 __swift_instantiateGenericMetadata + 3580
5  OneSignalInAppMessages         0xb2f4 __52-[OSMessagingController getInAppMessagesFromServer:]_block_invoke + 188
6  libdispatch.dylib              0x2248 _dispatch_call_block_and_release + 32
7  libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
8  libdispatch.dylib              0x70f4 _dispatch_queue_override_invoke + 916
9  libdispatch.dylib              0x15ec0 _dispatch_root_queue_drain + 392
10 libdispatch.dylib              0x166c4 _dispatch_worker_thread2 + 156
11 libsystem_pthread.dylib        0x3644 _pthread_wqthread + 228
12 libsystem_pthread.dylib        0x1474 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1510 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x36cc _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1474 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1510 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x36cc _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1474 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1510 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x36cc _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1474 start_wqthread + 8

com.apple.network.connections
0  CoreFoundation                      0xc720 CF_IS_OBJC + 112
1  CoreFoundation                      0x18f54 CFArrayGetCount + 32
2  CoreFoundation                      0x932c0 _copyResourceURLsFromBundle + 1236
3  CoreFoundation                      0x99b84 _CFBundleCopyFindResources + 1400
4  CoreFoundation                      0x995fc CFBundleCopyResourceURL + 56
5  CoreFoundation                      0x97f38 _CFBundleGetStringsSources + 992
6  CoreFoundation                      0x97928 CFBundleGetLocalInfoDictionary + 208
7  CoreFoundation                      0xd82ac CFBundleGetValueForInfoDictionaryKey + 44
8  libnetworkextension.dylib           0x1918 NEHelperIsHostnameDesignatedTracker + 76
9  libsystem_networkextension.dylib    0x3028 ne_tracker_check_is_hostname_blocked + 600
10 Network                             0x14fcc4 nw_endpoint_handler_path_change(NWConcrete_nw_endpoint_handler*) + 1748
11 Network                             0x2f80 nw_endpoint_handler_start + 1180
12 Network                             0x1d364c nw_endpoint_transform_start_next_child(NWConcrete_nw_endpoint_handler*) + 1092
13 Network                             0x1d656c nw_endpoint_transform_receive_report(NWConcrete_nw_endpoint_handler*, nw_endpoint_handler_mode_t, nw_connection_state_t, nw_endpoint_handler_event_s*, NSObject<OS_nw_error>*, NSObject<OS_nw_object>*) + 2956
14 Network                             0xe10f0 nw_endpoint_handler_report + 252
15 Network                             0x1e0bd0 nw_endpoint_resolver_update(NWConcrete_nw_endpoint_handler*, NSObject<OS_nw_resolver>*, nw_resolver_status_t) + 10980
16 Network                             0x37f78 __52-[NWConcrete_nw_endpoint_resolver startWithHandler:]_block_invoke_2 + 80
17 Network                             0x37ee8 invocation function for block in nw_resolver_update_client(NWConcrete_nw_resolver*, void () block_pointer) + 88
18 libdispatch.dylib                   0x2248 _dispatch_call_block_and_release + 32
19 libdispatch.dylib                   0x3fa8 _dispatch_client_callout + 20
20 libdispatch.dylib                   0xd76c _dispatch_workloop_invoke + 2172
21 libdispatch.dylib                   0x1738c _dispatch_root_queue_drain_deferred_wlh + 288
22 libdispatch.dylib                   0x16bd8 _dispatch_workloop_worker_thread + 540
23 libsystem_pthread.dylib             0x3680 _pthread_wqthread + 288
24 libsystem_pthread.dylib             0x1474 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1510 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x36cc _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1474 start_wqthread + 8

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nan-li
Copy link
Contributor

nan-li commented Dec 17, 2024

Hi @ashleydee1999 thank you for reporting,

We fixed this crash recently so please upgrade to Release 5.2.9. Reach out if you run into any other issues.

@nan-li nan-li closed this as completed Dec 17, 2024
@solibe1
Copy link

solibe1 commented Dec 18, 2024

@nan-li what about react native?

@nan-li
Copy link
Contributor

nan-li commented Dec 18, 2024

@solibe1 We will release the cross-platform SDKs next!

@solibe1
Copy link

solibe1 commented Dec 19, 2024

@nan-li when is that?

@nan-li
Copy link
Contributor

nan-li commented Dec 19, 2024

@solibe1 it has been released in react native onesignal Release 5.2.8

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

3 participants