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 in OutgoingMutationQueue #3325

Closed
kubatatami opened this issue Oct 25, 2023 · 15 comments
Closed

Crash in OutgoingMutationQueue #3325

kubatatami opened this issue Oct 25, 2023 · 15 comments
Labels
bug Something isn't working datastore Issues related to the DataStore category

Comments

@kubatatami
Copy link

Describe the bug

OutgoingMutationQueue Crashes.

Sample error reported:

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: SEGV_ACCERR at 0x4075e00000000018
Crashed Thread: 15

Application Specific Information:
Signal 11, Code 2 >
Attempted to dereference garbage pointer at 0x4075e00000000018.

Sample Stacktraces:

Thread 15 Crashed:
0   Foundation                      0x32b5d7a2c         __NSOQSchedule
1   Foundation                      0x32b603f44         -[NSOperationQueue setSuspended:]
2   Evie Beta                       0x202906c78         OutgoingMutationQueue.doStart (OutgoingMutationQueue.swift:142)
3   Evie Beta                       0x202909c70         OutgoingMutationQueue.queryMutationEventsFromStorage (OutgoingMutationQueue.swift:342)
4   Evie Beta                       0x2028cf964         SQLiteStorageEngineAdapter.query<T> (StorageEngineAdapter+SQLite.swift:335)
5   Evie Beta                       0x2028d03b8         SQLiteStorageEngineAdapter.query<T> (StorageEngineAdapter+SQLite.swift:304)
6   Evie Beta                       0x2028d2018         SQLiteStorageEngineAdapter
7   Evie Beta                       0x202906f4c         OutgoingMutationQueue.queryMutationEventsFromStorage (OutgoingMutationQueue.swift:331)
8   Evie Beta                       0x202906804         OutgoingMutationQueue.doStart (OutgoingMutationQueue.swift:141)
9   Evie Beta                       0x202906138         OutgoingMutationQueue.respond (OutgoingMutationQueue.swift:109)
10  Evie Beta                       0x20290c86c         [inlined] OutgoingMutationQueue.init (OutgoingMutationQueue.swift:78)
11  Evie Beta                       0x20290c86c         OutgoingMutationQueue.init
12  Evie Beta                       0x20288c6c0         thunk for closure
13  libdispatch.dylib               0x33d44c6a4         _dispatch_call_block_and_release
14  libdispatch.dylib               0x33d44e2fc         _dispatch_client_callout
15  libdispatch.dylib               0x33d455890         _dispatch_lane_serial_drain
16  libdispatch.dylib               0x33d4563c0         _dispatch_lane_invoke
17  libdispatch.dylib               0x33d461000         _dispatch_root_queue_drain_deferred_wlh
18  libdispatch.dylib               0x33d460874         _dispatch_workloop_worker_thread
19  libsystem_pthread.dylib         0x3ff9cf960         _pthread_wqthread

Steps To Reproduce

No steps to reproduce. Crash happens only sometimes.

Expected behavior

No crash

Amplify Framework Version

2.19.0

Amplify Categories

DataStore

Dependency manager

Swift PM

Swift version

5.9

CLI version

12.2.3

Xcode version

15.0

Relevant log output

N/A

Is this a regression?

No

Regression additional context

No response

Platforms

iOS

OS Version

all

Device

all

Specific to simulators

No response

Additional context

No response

@phantumcode
Copy link
Member

@kubatatami Thanks for submitting the issue. Can you provide your schema or a sample schema to help reproduce the issue?

@phantumcode phantumcode added datastore Issues related to the DataStore category pending-community-response Issue is pending response from the issue requestor bug Something isn't working labels Oct 25, 2023
@kubatatami
Copy link
Author

@phantumcode Sorry, I can't share the schema of a single table because I don't know which of the multiple tables is causing the problem. I'm not the owner of the project. This is proprietary software, so I cannot share the entire database schema.

@thisisabhash
Copy link
Member

Hello, Could you paste the verbose logs with sensitive information removed and reproduction steps so that we can try reproducing the issue. An approximate schema schema (for e.g. what model relations are present) and code snippets showing Amplify API calls would be helpful too.

On a side note, can you try upgrading to CLI 12.7.1 and Amplify Swift 2.21.4 to see if you're still facing the issues?

@kubatatami
Copy link
Author

Hey @thisisabhash We don't have reproduction steps. It crashes randomly for our users and we were not able to reproduce it locally. We just have ~20 tables with timestamp as a key and a few primitive types(int, double etc) columns in each table.
We use Amplify API in multiple places but mostly we do a simple query with where based on timestamp and simple save. We save a lot of rows but each row is small.
We will update Amplify Swift and I will let you know if it helps.

@fzy-github
Copy link

fzy-github commented Dec 4, 2023

we are having this crash in sdk v2.22.0 as well

@thisisabhash if updating cli, should the models be regenerated with new cli version?

I updated the CLI (to version 12.8.2) but I dont see any difference in generated models as compared to previous version

@kubatatami
Copy link
Author

@thisisabhash This is our “obfuscated” schema: schema.txt

@atierian atierian removed the pending-community-response Issue is pending response from the issue requestor label Dec 12, 2023
@madej10
Copy link

madej10 commented Dec 18, 2023

@thisisabhash @atierian could you please let us know if there are any updates to this? We keep experiencing the issue.

@lawmicha
Copy link
Member

Hey @madej10, @kubatatami, is this the same issue as #3407 ?

@kubatatami
Copy link
Author

Hey @lawmicha. No, it's not the same issue.

@lawmicha
Copy link
Member

@kubatatami can you include the full crash report?

@kubatatami
Copy link
Author

@lawmicha
Copy link
Member

Hey @kubatatami I'm attempting to fix the crash in #3429 Could you try out this branch and let us know if you see any improvements? lawmicha.fix-outgoing-queue

@thisisabhash thisisabhash added the pending-community-response Issue is pending response from the issue requestor label Jan 4, 2024
@lawmicha
Copy link
Member

lawmicha commented Jan 4, 2024

@github-actions github-actions bot removed the pending-community-response Issue is pending response from the issue requestor label Jan 4, 2024
@ruisebas ruisebas closed this as completed Jan 4, 2024
Copy link
Contributor

github-actions bot commented Jan 4, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@fzy-github
Copy link

@lawmicha We are still seeing the crash after update to amplify v.2.25.3.
Created new issue: #3467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working datastore Issues related to the DataStore category
Projects
None yet
Development

No branches or pull requests

8 participants