apptentive / apptentive-kit-ios

ApptentiveKit SDK for iOS and iPadOS
https://www.apptentive.com
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

ApptentiveKit.Conversation.merge(with: ApptentiveKit.Conversation) throws -> () #31

Closed SunnyGit closed 1 year ago

SunnyGit commented 1 year ago

App is crashing on launch randomly with the following signature

ApptentiveKit Version Used : 6.0.4

Initially used 6.0.5 and then downgraded to 6.0.4

Exception Type: SIGTRAP Exception Codes: TRAP_BRKPT at 0x1c83d7584 Crashed Thread: 19

Thread 19 Crashed: 0 libswiftCore.dylib 0x00000001c83d7584 0x1c83a8000 + 193924 1 libswiftCore.dylib 0x00000001c83d7870 0x1c83a8000 + 194672 2 ApptentiveKit 0x0000000103b0a70c ApptentiveKit.Conversation.merge(with: ApptentiveKit.Conversation) throws -> () (Conversation.swift:0) 3 ApptentiveKit 0x0000000103af1cdc ApptentiveKit.Backend.(loadConversation in _CE4A11A71D87B9D3E39C0EA2BC544396)(from: ApptentiveKit.Loader) throws -> () (Conversation.swift:108) 4 ApptentiveKit 0x0000000103b27a24 function signature specialization <Arg[2] = Dead, Arg[3] = Owned To Guaranteed> of function signature specialization <Arg[2] = [Closure Propagated : closure #1 (ApptentiveKit.Loader) throws -> () in ApptentiveKit.Backend.protectedDataDidBecomeAvailable(containerURL: Foundation.URL, cachesURL: Foundation.URL, environment: ApptentiveKit.AppEnvironment & ApptentiveKit.DeviceEnvironment & ApptentiveKit.PlatformEnvironment) throws -> (), Argument Types : [ApptentiveKit.Backend]> of static ApptentiveKit.CurrentLoader.loadLatestVersion(containerURL: Foundation.URL, environment: ApptentiveKit.AppEnvironment & ApptentiveKit.DeviceEnvironment & ApptentiveKit.PlatformEnvironment, completion: (ApptentiveKit.Loader) throws -> ()) -> () (Backend.swift:197) 5 ApptentiveKit 0x0000000103aede34 ApptentiveKit.Backend.protectedDataDidBecomeAvailable(containerURL: Foundation.URL, cachesURL: Foundation.URL, environment: ApptentiveKit.AppEnvironment & ApptentiveKit.DeviceEnvironment & ApptentiveKit.PlatformEnvironment) throws -> () (:0) 6 ApptentiveKit 0x0000000103ac1ccc closure #1 () -> () in ApptentiveKit.Apptentive.protectedDataDidBecomeAvailable(ApptentiveKit.AppEnvironment & ApptentiveKit.DeviceEnvironment & ApptentiveKit.PlatformEnvironment) -> () (Apptentive.swift:431) 7 ApptentiveKit 0x0000000103abab44 reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_unowned @convention(block) () -> () (:0) 8 libdispatch.dylib 0x00000001d52d6850 0x1d5273000 + 407632 9 libdispatch.dylib 0x00000001d52d77c8 0x1d5273000 + 411592 10 libdispatch.dylib 0x00000001d52b2854 0x1d5273000 + 260180 11 libdispatch.dylib 0x00000001d52b3318 0x1d5273000 + 262936 12 libdispatch.dylib 0x00000001d52bd000 0x1d5273000 + 303104 13 libsystem_pthread.dylib 0x0000000216b8ab50 0x216b89000 + 6992 14 libsystem_pthread.dylib 0x0000000216b8a67c 0x216b89000 + 5756

frankus commented 1 year ago

This looks like it's a known issue in v6.0.4. There is a somewhat serious bug that causes assertionFailure calls to crash in release builds, along with (what we think is) a rare race condition on SDK startup that triggers the assertion failure.

If you are able to update to v6.0.6, that should solve both issues.

SunnyGit commented 1 year ago

Thank you for the quick update, will give a try now. After upgrade if we see the issue is resolved will update the ticket.

SunnyGit commented 1 year ago

@frankus Issue is still reproducible but on beta 16.2

Screen Shot 2022-11-07 at 1 10 09 PM

Thread 18 Crashed: 0 libswiftCore.dylib 0x00000001c83d7584 0x1c83a8000 + 193924 1 libswiftCore.dylib 0x00000001c83d7870 0x1c83a8000 + 194672 2 ApptentiveKit 0x0000000102bdfb54 ApptentiveKit.Conversation.merge(with: ApptentiveKit.Conversation) throws -> () (Conversation.swift:0) 3 ApptentiveKit 0x0000000102bc78f8 ApptentiveKit.Backend.(loadConversation in _CE4A11A71D87B9D3E39C0EA2BC544396)(from: ApptentiveKit.Loader) throws -> () (Conversation.swift:108) 4 ApptentiveKit 0x0000000102bfd86c function signature specialization <Arg[2] = Dead, Arg[3] = Owned To Guaranteed> of function signature specialization <Arg[2] = [Closure Propagated : closure #1 (ApptentiveKit.Loader) throws -> () in ApptentiveKit.Backend.protectedDataDidBecomeAvailable(containerURL: Foundation.URL, cachesURL: Foundation.URL, environment: ApptentiveKit.AppEnvironment & ApptentiveKit.DeviceEnvironment & ApptentiveKit.PlatformEnvironment) throws -> (), Argument Types : [ApptentiveKit.Backend]> of static ApptentiveKit.CurrentLoader.loadLatestVersion(containerURL: Foundation.URL, environment: ApptentiveKit.AppEnvironment & ApptentiveKit.DeviceEnvironment & ApptentiveKit.PlatformEnvironment, completion: (ApptentiveKit.Loader) throws -> ()) -> () (Backend.swift:197) 5 ApptentiveKit 0x0000000102bc36e4 ApptentiveKit.Backend.protectedDataDidBecomeAvailable(containerURL: Foundation.URL, cachesURL: Foundation.URL, environment: ApptentiveKit.AppEnvironment & ApptentiveKit.DeviceEnvironment & ApptentiveKit.PlatformEnvironment) throws -> () (:0) 6 ApptentiveKit 0x0000000102b95150 closure #1 () -> () in ApptentiveKit.Apptentive.protectedDataDidBecomeAvailable(ApptentiveKit.AppEnvironment & ApptentiveKit.DeviceEnvironment & ApptentiveKit.PlatformEnvironment) -> () (Apptentive.swift:431) 7 ApptentiveKit 0x0000000102b8fa10 reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_unowned @convention(block) () -> () (:0) 8 libdispatch.dylib 0x00000001d52d6850 0x1d5273000 + 407632 9 libdispatch.dylib 0x00000001d52d77c8 0x1d5273000 + 411592 10 libdispatch.dylib 0x00000001d52b2854 0x1d5273000 + 260180 11 libdispatch.dylib 0x00000001d52b3318 0x1d5273000 + 262936 12 libdispatch.dylib 0x00000001d52bd000 0x1d5273000 + 303104 13 libsystem_pthread.dylib 0x0000000216b8ab50 0x216b89000 + 6992 14 libsystem_pthread.dylib 0x0000000216b8a67c 0x216b89000 + 5756

frankus commented 1 year ago

@SunnyGit do you have data on whether this is still occurring with v6.0.6 of our SDK?

SunnyGit commented 1 year ago

@frankus Issue is still reproducible but on beta 16.2 ,is it supported version ?

SunnyGit commented 1 year ago

@frankus Please close this one, issue is not reproducible now.