Skip to content

[Bug]: Crash in v5.2.14: OneSignal.OSOperationRepo - OSSubscriptionModel.encode(with:) + 298 (OSSubscriptionModel.swift:298) #1588

@ethanwa

Description

@ethanwa

What happened?

Got this crash appearing in Crashlytics:

Crashed: OneSignal.OSOperationRepo
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000003f531c9f8

Crashed: OneSignal.OSOperationRepo
0  libobjc.A.dylib                0x7b98 objc_retain + 16
1  libobjc.A.dylib                0x7b98 objc_retain_x0 + 16
2  libswiftCore.dylib             0x3fb018 objcRetainAndReturn(void*) + 32
3  OneSignalUser                  0x32d1c OSSubscriptionModel.encode(with:) + 298 (OSSubscriptionModel.swift:298)
4  OneSignalUser                  0x331ec @objc OSSubscriptionModel.encode(with:) + 30792 (<compiler-generated>:30792)
5  Foundation                     0x5f670 _encodeObject + 1176
6  OneSignalOSCore                0x113a4 OSDelta.encode(with:) + 62 (OSDelta.swift:62)
7  OneSignalOSCore                0x114b8 @objc OSDelta.encode(with:) + 25532 (<compiler-generated>:25532)
8  Foundation                     0x5f670 _encodeObject + 1176
9  Foundation                     0x5f018 -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] + 460
10 Foundation                     0x293a8 -[NSArray(NSArray) encodeWithCoder:] + 584
11 Foundation                     0x5f670 _encodeObject + 1176
12 Foundation                     0x2c39dc +[NSKeyedArchiver archivedDataWithRootObject:] + 104
13 OneSignalCore                  0xd434 -[OneSignalUserDefaults saveCodeableDataForKey:withValue:] + 162 (OneSignalUserDefaults.m:162)
14 OneSignalOSCore                0x4fd4 closure #1 in OSOperationRepo.enqueueDelta(_:flush:) + 2748
15 OneSignalOSCore                0x5064 thunk for @escaping @callee_guaranteed @Sendable () -> () + 2892
16 libdispatch.dylib              0x1aac _dispatch_call_block_and_release + 32
17 libdispatch.dylib              0x1b584 _dispatch_client_callout + 16
18 libdispatch.dylib              0xa2d0 _dispatch_lane_serial_drain + 740
19 libdispatch.dylib              0xadac _dispatch_lane_invoke + 388
20 libdispatch.dylib              0x151dc _dispatch_root_queue_drain_deferred_wlh + 292
21 libdispatch.dylib              0x14a60 _dispatch_workloop_worker_thread + 540
22 libsystem_pthread.dylib        0xa0c _pthread_wqthread + 292
23 libsystem_pthread.dylib        0xaac start_wqthread + 8

Steps to reproduce?

I'm not sure how to repro. It came in from a user:

App version: 9.2.1 (9201)
OS version: iosiOS 18.6.2
Model: iPhone 15 Pro Max
Date: Aug 30, 2025, 5:12:21 AM

What did you expect to happen?

No crash.

OneSignal iOS SDK version

5.2.14

iOS version

18

Specific iOS version

18.6.2

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions