Object 0x10bee2ff0 of class _DictionaryStorage deallocated with non-zero retain count 2

HI!

Trying to figure out a particularly odd crash report (via crashlytics).

Crashed: com.apple.main-thread
0  libsystem_kernel.dylib         0x7558 __pthread_kill + 8
1  libsystem_pthread.dylib        0x7118 pthread_kill + 268
2  libsystem_c.dylib              0x1d178 abort + 180
3  libswiftCore.dylib             0x3b93a8 swift::fatalError(unsigned int, char const*, ...) + 134
4  libswiftCore.dylib             0x3b93c8 swift::warningv(unsigned int, char const*, char*) + 30
5  libswiftCore.dylib             0x3bdfd8 swift_deallocPartialClassInstance + 190
6  libswiftCore.dylib             0x3bde28 _swift_release_dealloc + 56
7  libswiftCore.dylib             0x3bec4c bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 132
8  PSStore                        0xab8de0 ThankYouViewController.viewCleanup() + 32 (TwoPhaseCommitHelper.swift:32)

Complete stackTrace here

The stack trace line that refers to our code points to a specific implementation of a ThreadedDictionary where we are removing all the objects inside the internal storage:

We have not been able to reproduce this crash, however we are seeing multiple instances in our crash reports for it (All instances happening in iPadOS + 16.4.1 devices).

Is there anything relevant to take a look in the first 7 frames of the crash report to understand what could be the issue?

While researching on this, we identified a post with a very similar stacktrace entries: https://developer.apple.com/forums/thread/729196?login=true&page=1#752337022

We are not using GC or Unity, however the first entries in the stack trace look very similar.

Rgds!

Replies

Do you have an Apple crash report for this? If so, please post the whole thing. See Posting a Crash Report for advice on how to do that.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hi!

Unfortunately we don't have an Apple crash report, crashlytics stack trace is the only information we have for this crash. :(

Hello, we are seeing occurrences of the same kind of crash while working with collection in Swift.

crash stack of the crash is as below:

0    libsystem_kernel.dylib                   0x1d810e974     __pthread_kill + 8
1    libsystem_c.dylib                        0x197b57b80     abort + 179
2    libswiftCore.dylib                       0x18e85a690     swift::fatalErrorv(unsigned int, char const*, char*) + 135
3    libswiftCore.dylib                       0x18e85a6b0     swift::fatalError(unsigned int, char const*, ...) + 31
4    libswiftCore.dylib                       0x18e85f4dc     swift_deallocClassInstance + 307
5    libswiftCore.dylib                       0x18e85f36c     _swift_release_dealloc + 55
6    libswiftCore.dylib                       0x18e860488     bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 135

crash message:

# Cause: Object 0x12d4e8000 of class _DictionaryStorage deallocated with non-zero retain count 3. This object's deinit, or something called from it, may have created a strong reference to self which outlived deinit, resulting in a dangling reference.

Again, I need a full Apple crash report to offer an opinion about this.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I'm having the same issue. And it started in a line that doesn't changed in the last update. I'm attaching the crashpoint that includes some crashes. Could you help us?

I add the attachment. Sorry I couldn't add the report. I give you a WeTransfer Link https://we.tl/t-VHOkQIs6TO