supabase / supabase-swift

A Swift client for Supabase

Home Page:https://supabase.com/docs/reference/swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Random crash from Supabase code right after app launch

kevlust opened this issue · comments

Bug report

Describe the bug

My iOS app that uses this package crashed a few seconds after launch. Upon reading through the crash stack trace, I noticed that this is happening due to some code from this package.

This happens very randomly (I can't manually reproduce this crash). However, I think (not 100% sure) this has happened when testing the app with bad reception, so that might be helpful here. I'll keep trying to reproduce this.

System information

  • iOS: 17.2.1
  • iPhone 14 Pro
  • Supabase 2.2.1
  • KeychainAccess 4.2.2

Additional context

Crashed: com.apple.root.user-initiated-qos.cooperative
0  libsystem_kernel.dylib         0x9fbc __pthread_kill + 8
1  libsystem_pthread.dylib        0x5680 pthread_kill + 268
2  libsystem_c.dylib              0x75b90 abort + 180
3  libsystem_malloc.dylib         0x26200 malloc_vreport + 908
4  libsystem_malloc.dylib         0x264a8 malloc_zone_error + 104
5  libsystem_malloc.dylib         0x1dac8 nanov2_guard_corruption_detected + 44
6  libsystem_malloc.dylib         0x7e78 nanov2_find_block_and_allocate + 402
7  libswiftCore.dylib             0x3a2c80 swift::swift_slowAllocTyped(unsigned long, unsigned long, unsigned long long) + 104
8  libswiftCore.dylib             0x3a7888 _swift_allocObject_ + 1088
9  libswiftCore.dylib             0x33bfcc specialized static _DictionaryStorage.resize(original:capacity:move:) + 372
10 libswiftCore.dylib             0x17ae08 _NativeDictionary._copyOrMoveAndResize(capacity:moveElements:) + 300
11 libswiftCore.dylib             0xd1e34 _NativeDictionary.setValue(_:forKey:isUnique:) + 272
12 libswiftCore.dylib             0xab6d8 Dictionary._Variant.setValue(_:forKey:) + 228
13 libswiftCore.dylib             0x58624 Dictionary.subscript.setter + 512
14 MyApp                          0xf9cf78 Options.query(ignoringAttributeSynchronizable:) + 1331 (Keychain.swift:1331)
15 MyApp                          0xf9c694 Keychain.getData(_:ignoringAttributeSynchronizable:) + 611 (Keychain.swift:611)
16 MyApp                          0xe412f4 KeychainLocalStorage.retrieve(key:) + 21 (KeychainLocalStorage.swift:21)
17 MyApp                          0xe414c0 protocol witness for AuthLocalStorage.retrieve(key:) in conformance KeychainLocalStorage + 28 (<compiler-generated>:28)
18 MyApp                          0xe3b94c closure #1 in closure #1 in variable initialization expression of static SessionStorage.live + 40 (SessionStorage.swift:40)
19 MyApp                          0xe34050 _LiveSessionManager.session(shouldValidateExpiration:) + 45 (SessionManager.swift:45)
20 libswift_Concurrency.dylib     0x41ac4 swift::runJobInEstablishedExecutorContext(swift::Job*) + 436
21 libswift_Concurrency.dylib     0x42d54 swift_job_runImpl(swift::Job*, swift::ExecutorRef) + 72
22 libdispatch.dylib              0x15be4 _dispatch_root_queue_drain + 392
23 libdispatch.dylib              0x163ec _dispatch_worker_thread2 + 156
24 libsystem_pthread.dylib        0x1928 _pthread_wqthread + 228
25 libsystem_pthread.dylib        0x1a04 start_wqthread + 8
abort() called
Heap corruption detected, free list is damaged at 0x28398aec0 *** Incorrect guard value: 72057602592842937

Hi @kevlust

Are you still facing this crash?

@grdsdev I'm facing a similar, but different crash in version 2.9.0. I'll open a new issue about it!