Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on AppSyncRealTimeClient.monitorHeartBeats(_:) + 428 #3748

Open
amruth-movano opened this issue Jun 14, 2024 · 21 comments
Open

Crash on AppSyncRealTimeClient.monitorHeartBeats(_:) + 428 #3748

amruth-movano opened this issue Jun 14, 2024 · 21 comments
Labels
api Issues related to the API category bug Something isn't working datastore Issues related to the DataStore category

Comments

@amruth-movano
Copy link

amruth-movano commented Jun 14, 2024

Describe the bug

Our production users are getting crash in AppSyncRealTimeClient.monitorHeartBeats(_:) + 428
Below is the crash log

          Crashed: com.apple.root.default-qos
0  libswiftCore.dylib             0x4065b4 swift_isUniquelyReferenced_nonNull_native + 38
1  Combine                        0x23d70 AnyCancellable.store(in:) + 48
2  Evie Ring                      0x13e4024 closure #1 in AppSyncRealTimeClient.monitorHeartBeats(_:) + 428 (AppSyncRealTimeClient.swift:428)
3  Evie Ring                      0x13e5998 partial apply for thunk for @escaping @callee_guaranteed () -> () + 4355873176 (<compiler-generated>:4355873176)
4  Combine                        0xaecc Subscribers.Sink.receive(_:) + 92
5  Combine                        0xae60 protocol witness for Subscriber.receive(_:) in conformance Subscribers.Sink<A, B> + 24
6  Combine                        0x3322c ReduceProducer.receive(_:) + 2312
7  Combine                        0x1a304 protocol witness for Subscriber.receive(_:) in conformance ReduceProducer<A, B, C, D, E> + 24
8  Combine                        0x651bc closure #1 in Publishers.Debounce.Inner.receive(_:) + 2780
9  libswiftDispatch.dylib         0x2c84 thunk for @escaping @callee_guaranteed () -> () + 36
10 libdispatch.dylib              0x3dd4 _dispatch_client_callout + 20
11 libdispatch.dylib              0x72d8 _dispatch_continuation_pop + 600
12 libdispatch.dylib              0x1b1c8 _dispatch_source_latch_and_call + 420
13 libdispatch.dylib              0x19d8c _dispatch_source_invoke + 832
14 libdispatch.dylib              0x15894 _dispatch_root_queue_drain + 392
15 libdispatch.dylib              0x1609c _dispatch_worker_thread2 + 156
16 libsystem_pthread.dylib        0x48f8 _pthread_wqthread + 228
17 libsystem_pthread.dylib        0x10cc start_wqthread + 8

Steps To Reproduce

-

Expected behavior

It should not crash

Amplify Framework Version

2.33.6

Amplify Categories

API, DataStore

Dependency manager

Swift PM

Swift version

5.9.2

CLI version

12.11.1

Xcode version

15.0

Relevant log output

No response

Is this a regression?

Yes

Regression additional context

No response

Platforms

iOS

OS Version

iOS 17.5.1

Device

iPhone 13 :Pro

Specific to simulators

No response

Additional context

No response

@thisisabhash thisisabhash added bug Something isn't working api Issues related to the API category datastore Issues related to the DataStore category labels Jun 14, 2024
@thisisabhash
Copy link
Member

Hello,
Thank you for posting this.

  • Could you please post reproduction steps and the verbose logs for the issue with sensitive info redacted?
  • We have shipped a number of fixes in Datastore and API category since the version being used in this (2.33.6). Could you please update the version to latest (2.35.3)?

@amruth-movano
Copy link
Author

It is not reproducible but there are almost more than 50 crash in same file for our production users

@5d
Copy link
Member

5d commented Jun 18, 2024

@amruth-movano Thank you for providing the crash reports. I'll investigate to see if I can reproduce the issue.

@amruth-movano
Copy link
Author

@5d Did you get any hint in this, as many users are seeing this crash?

@harsh62
Copy link
Member

harsh62 commented Jul 11, 2024

@amruth-movano Our team is still trying to reproduce this issue in our local environment. You said its not reproducible, but are you able to deduce from the usage of Amplify on what are the most likely possible steps?

@thisisabhash
Copy link
Member

Thank you for your patience - we will investigate and post updates.

@5d
Copy link
Member

5d commented Jul 29, 2024

Hi @amruth-movano ,

Unfortunately, I couldn't reproduce the issue.
Based on the stack traces, one potential cause could be that the actor-guarded property cancellables is not running in an isolated context with Apple's AnyCancellable.store(in:). I've made a potential fix on the branch 5d/fix-3748. I will discuss this with the team to see if this could mitigate the issue.

@minaamaw-sl
Copy link

Hi @5d,

I am also facing this issue on version 2.29.1. There are lots of Crashes due to this. What measures can I take to prevent this? I have looked over the release notes of all the recent Amplify Versions, but none of them mentioned this issue being fixed.

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Aug 20, 2024
@lawmicha
Copy link
Member

Hi @minaamaw-sl, were you able to try out the 5d/fix-3748 branch in your app to resolve the issue?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Aug 20, 2024
@minaamaw-sl
Copy link

@lawmicha, I have not tried it as I am unable to reproduce it, however Analytics show that it does Crash for some users.

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Aug 21, 2024
@harsh62
Copy link
Member

harsh62 commented Aug 23, 2024

@minaamaw-sl Our team will review the attached PR and provide an update once it gets merged.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Aug 23, 2024
@amruth-movano
Copy link
Author

@harsh62 @lawmicha @5d @thisisabhash
Could you let me know if the solution has yet been released to users?
We have lots of users facing this?

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Aug 26, 2024
@harsh62
Copy link
Member

harsh62 commented Aug 27, 2024

Possibly related: #3834 , #3835

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Aug 27, 2024
@amruth-movano
Copy link
Author

@harsh62 Thanks for checking. Can you let us know when are we going to release it in new version?

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Aug 27, 2024
@tylerjroach
Copy link
Member

#3824 has been released in 2.39.0. Please let us know if you are still seeing the crash after upgrading to that version.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Aug 29, 2024
@vincetran vincetran added the pending-community-response Issue is pending response from the issue requestor label Sep 17, 2024
@vincetran vincetran added the closing soon This issue will be closed in 7 days unless further comments are made. label Sep 17, 2024
@tenaz92
Copy link

tenaz92 commented Sep 18, 2024

Hi,
i am still getting this crash after updating the library to 2.39.0
Screenshot 2024-09-18 at 9 18 23 AM
Screenshot 2024-09-18 at 9 21 00 AM

@github-actions github-actions bot added pending-maintainer-response Issue is pending response from an Amplify team member and removed pending-community-response Issue is pending response from the issue requestor labels Sep 18, 2024
@5d
Copy link
Member

5d commented Sep 18, 2024

Hi @tenaz92 ,

Could you please share the complete crash log? I see that you're using version 2.39.0. However, based on the screeshot, AppSyncRealTimeClient.swift#L428 in version 2.39.0 doesn't seem to be associated with the monitorHeartBeats function.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 18, 2024
@phantumcode phantumcode removed the closing soon This issue will be closed in 7 days unless further comments are made. label Sep 24, 2024
@zachfields
Copy link

Confirming I am also still having the same issue. It appears to happen when the app has been left open for a while on a user's device.

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 4, 2024
@5d
Copy link
Member

5d commented Oct 4, 2024

Hi @zachfields ,
We appreciate your confirmation. Our team will attempt to replicate the issue. To assist us further, would you be able to provide the symbolicated crash logs for the most recent crash that occurred after updating to version 2.39.0?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues related to the API category bug Something isn't working datastore Issues related to the DataStore category
Projects
None yet
Development

No branches or pull requests