Skip to content

[Bug]: N12_GLOBAL__N_122ExceptionObjHolderImplE crash when updating tags on background threads #1587

@marioortizmanero

Description

@marioortizmanero

What happened?

Description

We’re seeing intermittent production crashes stemming from OneSignalUserDefaults.saveCodeableDataForKey after calling OneSignal.User.addTag/removeTag. The stack trace indicates a C++ exception (N12_GLOBAL__N_122ExceptionObjHolderImplE) that appears whenever tag updates originate from a background thread (e.g., triggered by Superwall events or Kotlin background timers).

Image Image Image Image Image

This issue happens at different points throughout the app - not just the initialization.

Steps to reproduce?

From a background thread, call:


OneSignal.User.addTag(key: "some_key", value: "some_value")


Allow the SDK to persist tags to user defaults.

Observe crash in OneSignalUserDefaults.saveCodeableDataForKey.

Note that I haven't been able to reproduce this myself... It's only my hypothesis - any help would be appreciated.

Another question is whether I need to call getTags in a particular thread - is it blocking, should I call on Main? etc

What did you expect to happen?

No crashes

OneSignal iOS SDK version

5.2.14

iOS version

18

Specific iOS version

see image attached

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions