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 ActorIsolated line 21 #156

Closed
sarperdag opened this issue Nov 13, 2023 · 8 comments
Closed

Crash on ActorIsolated line 21 #156

sarperdag opened this issue Nov 13, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@sarperdag
Copy link

sarperdag commented Nov 13, 2023

Bug report

Describe the bug

Recently started using the main branch in production and getting a crash on my app at ActorIsolated.withValue(_:) (ActorIsolated.swift:0). Can't figure out what the problem is.

Crash due to signal: SIGABRT(#0) at 1e4e89578
$defer #1 () in ActorIsolated.withValue(_:) (ActorIsolated.swift:21 )

To Reproduce

Randomly occurs. I haven't been able to find a specific case yet.

Expected behavior

The crash shouldn't occur.

System information

  • OS: iPhone14 Pro iOS 17
  • Version of supabase-swift: main branch

Additional context

Here's the full stack trace:

data:text/text;charset=utf-8,

Cause: Crash due to signal: SIGABRT(#0) at 1e4e89578
Reported at: 2023-11-12 18:13:58 UTC

Thread 0 Unknown:

0 libsystem_kernel.dylib 0x1e4e82ca4 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x1e4e95e4c mach_msg_overwrite + 539
2 libsystem_kernel.dylib 0x1e4e831e8 mach_msg + 23
3 CoreFoundation 0x1a5f3c024 __CFRunLoopServiceMachPort + 159
4 CoreFoundation 0x1a5f3d250 __CFRunLoopRun + 1207
5 CoreFoundation 0x1a5f423ec CFRunLoopRunSpecific + 611
6 GraphicsServices 0x1e145835c GSEventRunModal + 163
7 UIKitCore 0x1a82cef58 -[UIApplication _run] + 887
8 UIKitCore 0x1a82cebbc UIApplicationMain + 339
9 MyApp 0x10033ace8 main (AppDelegate.swift:17)

Thread 1 Unknown:

0 libsystem_kernel.dylib 0x1e4e82ca4 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x1e4e95e4c mach_msg_overwrite + 539
2 libsystem_kernel.dylib 0x1e4e831e8 mach_msg + 23
3 CoreFoundation 0x1a5f3c024 __CFRunLoopServiceMachPort + 159
4 CoreFoundation 0x1a5f3d250 __CFRunLoopRun + 1207
5 CoreFoundation 0x1a5f423ec CFRunLoopRunSpecific + 611
6 Foundation 0x1a01b6fb4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 211
7 Foundation 0x1a01b6e9c -[NSRunLoop(NSRunLoop) runUntilDate:] + 63
8 UIKitCore 0x1a8401cc8 -[UIEventFetcher threadMain] + 415
9 Foundation 0x1a01d0524 NSThread__start + 715
10 libsystem_pthread.dylib 0x205cfe6b8 _pthread_start + 147
11 libsystem_pthread.dylib 0x205cfdb88 thread_start + 7

Thread 2 Unknown:

0 libsystem_kernel.dylib 0x1e4e82ca4 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x1e4e95e4c mach_msg_overwrite + 539
2 libsystem_kernel.dylib 0x1e4e831e8 mach_msg + 23
3 Instabug 0x101688cc4 exception_server_thread + 187
4 libsystem_pthread.dylib 0x205cfe6b8 _pthread_start + 147
5 libsystem_pthread.dylib 0x205cfdb88 thread_start + 7

Thread 3 Unknown:

0 libsystem_kernel.dylib 0x1e4e82ca4 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x1e4e95e4c mach_msg_overwrite + 539
2 libsystem_kernel.dylib 0x1e4e831e8 mach_msg + 23
3 CoreFoundation 0x1a5f3c024 __CFRunLoopServiceMachPort + 159
4 CoreFoundation 0x1a5f3d250 __CFRunLoopRun + 1207
5 CoreFoundation 0x1a5f423ec CFRunLoopRunSpecific + 611
6 CFNetwork 0x1a712d6f0 _CFURLStorageSessionDisableCache + 60899
7 Foundation 0x1a01d0524 NSThread__start + 715
8 libsystem_pthread.dylib 0x205cfe6b8 _pthread_start + 147
9 libsystem_pthread.dylib 0x205cfdb88 thread_start + 7

Thread 4 Unknown:

0 libsystem_kernel.dylib 0x1e4e831ac __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x205cfdb7c start_wqthread + 7

Thread 5 Unknown [Crashed]:

0 libsystem_kernel.dylib 0x1e4e89578 __pthread_kill + 8
1 libsystem_c.dylib 0x1ad3f4178 abort + 179
2 libsystem_malloc.dylib 0x1b43680e4 malloc_vreport + 907
3 libsystem_malloc.dylib 0x1b436838c malloc_zone_error + 103
4 libsystem_malloc.dylib 0x1b435d450 free_small_botch + 39
5 libswiftCore.dylib 0x19ffa5618 swift_release_dealloc + 55
6 libswiftCore.dylib 0x19ffa643c bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 131
7 libswiftCore.dylib 0x19ffa80e8 swift::metadataimpl::ValueWitnesses
swift::metadataimpl::BridgeObjectBox::assignWithTake(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadataswift::InProcess const*) + 35
8 MyApp 0x1003d94dc $defer #1 () in ActorIsolated.withValue(
:) (ActorIsolated.swift:21)
9 MyApp 0x1003d9418 ActorIsolated.withValue(_:) (ActorIsolated.swift:0)
10 MyApp 0x100418a90 closure #1 in closure #1 in variable initialization expression of static EventEmitter.live (EventEmitter.swift:36)
11 libswift_Concurrency.dylib 0x1b0287948 swift::runJobInEstablishedExecutorContext(swift::Job*) + 415
12 libswift_Concurrency.dylib 0x1b0288868 swift_job_runImpl(swift::Job*, swift::ExecutorRef) + 71
13 libdispatch.dylib 0x1ad3a5944 _dispatch_root_queue_drain + 395
14 libdispatch.dylib 0x1ad3a6158 _dispatch_worker_thread2 + 163
15 libsystem_pthread.dylib 0x205cfdda0 _pthread_wqthread + 227
16 libsystem_pthread.dylib 0x205cfdb7c start_wqthread + 7

Thread 6 Unknown:

0 libsystem_kernel.dylib 0x1e4e831ac __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x205cfdb7c start_wqthread + 7

Thread 7 Unknown:

0 libsqlite3.dylib 0x1caf303a4 sqlite3_sourceid + 425788
1 libsqlite3.dylib 0x1cae5551c sqlite3_log + 1075
2 libsqlite3.dylib 0x1caed3b0c sqlite3_sourceid + 46755
3 libsqlite3.dylib 0x1cae511ac sqlite3_finalize + 3863
4 libsqlite3.dylib 0x1cae68c68 sqlite3_step + 6795
5 libsqlite3.dylib 0x1cae675b4 sqlite3_step + 983
6 CoreData 0x1ad5f2128 _execute + 119
7 CoreData 0x1ad5bd11c -[NSSQLiteConnection execute] + 1803
8 CoreData 0x1ad5bb450 newFetchedRowsForFetchPlan_MT + 535
9 CoreData 0x1ad5b85cc _executeFetchRequest + 55
10 CoreData 0x1ad5d8bbc -[NSSQLFetchRequestContext executeRequestCore:] + 35
11 CoreData 0x1ad5d886c -[NSSQLStoreRequestContext executeRequestUsingConnection:] + 251
12 CoreData 0x1ad5d84b0 __52-[NSSQLDefaultConnectionManager handleStoreRequest:]_block_invoke + 59
13 CoreData 0x1ad67ad80 __37-[NSSQLiteConnection performAndWait:]_block_invoke + 47
14 libdispatch.dylib 0x1ad393eac _dispatch_client_callout + 19
15 libdispatch.dylib 0x1ad3a3428 _dispatch_lane_barrier_sync_invoke_and_complete + 55
16 CoreData 0x1ad67ac20 -[NSSQLiteConnection performAndWait:] + 175
17 CoreData 0x1ad5c7f68 -[NSSQLDefaultConnectionManager handleStoreRequest:] + 247
18 CoreData 0x1ad5c7e38 -[NSSQLCoreDispatchManager routeStoreRequest:] + 227
19 CoreData 0x1ad5b7200 -[NSSQLCore dispatchRequest:withRetries:] + 171
20 CoreData 0x1ad5c2a78 -[NSSQLCore executeRequest:withContext:error:] + 3391
21 CoreData 0x1ad72f62c _65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke.551 + 4167
22 CoreData 0x1ad5fb678 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 263
23 CoreData 0x1ad5c16d8 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1059
24 Instabug 0x1014e506c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 35
25 Instabug 0x1014e4fd4 __95-[IBGCoreDataRequestsSwizzler swizzleStoreCoordinatorExecuteRequestWithBeforeBlock:afterBlock:]block_invoke + 155
26 CoreData 0x1ad5b49fc -[NSManagedObjectContext executeFetchRequest:error:] + 687
27 CoreData 0x1ad5afb14 -[NSManagedObjectContext executeRequest:error:] + 315
28 CoreData 0x1ad6c27ec NSManagedObjectContext.fetch
(:) + 83
29 Instabug 0x10156fbf8 specialized APMPersistenceManager.fetchNetworkTrace(from:with:) + 103
30 Instabug 0x10156cb6c closure #1 in APMPersistenceManager.updateNetworkTraceWithResponse(statusCode:requestSize:responseSize:error:responseHeaders:hasResponse:attributes:uniqueID:startTimeStamp:backgroundTransitionEvaluator:gqlQueryName:gqlError:completionHandler:) + 267
31 Instabug 0x101570028 partial apply for closure #1 in APMPersistenceManager.updateNetworkTraceWithResponse(statusCode:requestSize:responseSize:error:responseHeaders:hasResponse:attributes:uniqueID:startTimeStamp:backgroundTransitionEvaluator:gqlQueryName:gqlError:completionHandler:) + 95
32 Instabug 0x1013e34f8 thunk for @escaping @callee_guaranteed (@guaranteed NSManagedObjectContext?) -> () + 51
33 Instabug 0x10147c880 __70-[IBGDALService writeASyncAfterCoreDataIntialization:completionBlock:]_block_invoke_3 + 51
34 CoreData 0x1ad61cb6c developerSubmittedBlockToNSManagedObjectContextPerform + 155
35 libdispatch.dylib 0x1ad393eac _dispatch_client_callout + 19
36 libdispatch.dylib 0x1ad39b534 _dispatch_lane_serial_drain + 667
37 libdispatch.dylib 0x1ad39c0a4 _dispatch_lane_invoke + 383
38 libdispatch.dylib 0x1ad3a6cdc _dispatch_workloop_worker_thread + 647
39 libsystem_pthread.dylib 0x205cfdddc _pthread_wqthread + 287
40 libsystem_pthread.dylib 0x205cfdb7c start_wqthread + 7

Thread 8 Unknown:

0 libsystem_kernel.dylib 0x1e4e831ac __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x205cfdb7c start_wqthread + 7

Thread 9 Unknown:

0 libsystem_kernel.dylib 0x1e4e82ca4 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x1e4e95e4c mach_msg_overwrite + 539
2 libsystem_kernel.dylib 0x1e4e831e8 mach_msg + 23
3 libdispatch.dylib 0x1ad3af20c dispatch_mach_send_and_wait_for_reply + 547
4 libdispatch.dylib 0x1ad3af59c dispatch_mach_send_with_result_and_wait_for_reply + 59
5 libxpc.dylib 0x205d50218 xpc_connection_send_message_with_reply_sync + 239
6 Security 0x1adbb9a0c securityd_message_with_reply_sync + 123
7 Security 0x1adbc3a0c securityd_send_sync_and_do + 87
8 Security 0x1adc773b8 cftype_to_bool_cftype_error_request + 159
9 Security 0x1adbb4038 __SecItemCopyMatching_block_invoke_2 + 199
10 Security 0x1adbb6fd0 __SecItemAuthDoQuery_block_invoke + 531
11 Security 0x1adbb5c00 SecItemAuthDoQuery + 1315
12 Security 0x1adbb6ca0 __SecItemCopyMatching_block_invoke + 139
13 Security 0x1adbbc8f8 SecOSStatusWith + 55
14 Security 0x1adbb6b68 SecItemCopyMatching + 399
15 MyApp 0x1004783fc Keychain.getData(
:ignoringAttributeSynchronizable:) (Keychain.swift:619)
16 MyApp 0x1004108a8 protocol witness for GoTrueLocalStorage.retrieve(key:) in conformance KeychainLocalStorage (:25)
17 MyApp 0x10041ee98 closure #1 in closure #1 in variable initialization expression of static SessionStorage.live (SessionStorage.swift:40)
18 MyApp 0x10041cb40 _LiveSessionManager.session(shouldValidateExpiration:) (SessionManager.swift:46)
19 libswift_Concurrency.dylib 0x1b0287948 swift::runJobInEstablishedExecutorContext(swift::Job*) + 415
20 libswift_Concurrency.dylib 0x1b0288868 swift_job_runImpl(swift::Job*, swift::ExecutorRef) + 71
21 libdispatch.dylib 0x1ad3a5944 _dispatch_root_queue_drain + 395
22 libdispatch.dylib 0x1ad3a6158 _dispatch_worker_thread2 + 163
23 libsystem_pthread.dylib 0x205cfdda0 _pthread_wqthread + 227
24 libsystem_pthread.dylib 0x205cfdb7c start_wqthread + 7

Binary Images:

0x1e4e82000 libsystem_kernel.dylib arm64e 681B06A0-7F6B-3FA3-A2CE-063DC1DA7B1B
0x1a5ec3000 CoreFoundation arm64e A900B459-0127-379E-9CBA-0EAB9C5D559F
0x1e1457000 GraphicsServices arm64e CD8D7195-14E1-3C7C-A8C9-50CCEA9F2A17
0x1a7f32000 UIKitCore arm64e 7D57A1D1-856F-338D-97DB-880C4EC8B02E
0x10028c000 MyApp arm64e 764CDECD-3BAB-3C6E-B881-0821B5B7934B
0x1a0175000 Foundation arm64e 1715DE5D-0893-3AF0-B0C0-550BB14F91EC
0x205cfd000 libsystem_pthread.dylib arm64e AA302F5A-FFE5-327A-A003-3B288B935DE1
0x101328000 Instabug arm64e E7171769-1401-3B16-BC19-B13FCD2F72B5
0x1a6ed5000 CFNetwork arm64e 045D4271-E64E-3229-A49F-CAFF707AA77F
0x1ad3d7000 libsystem_c.dylib arm64e 073251D1-D4C9-3774-8CEE-75210751A5D8
0x1b434a000 libsystem_malloc.dylib arm64e 8FEF35C1-D120-3B15-8E5A-3612C9D89E76
0x19fbe8000 libswiftCore.dylib arm64e A4726D93-1798-3386-8C58-72E17D96A1A4
0x1b0246000 libswift_Concurrency.dylib arm64e 53AFE373-F6C9-315B-AD69-59C8FF1D65E7
0x1ad390000 libdispatch.dylib arm64e 5D16936B-4E4C-3276-BA7A-69C9BC760ABA
0x1cae3c000 libsqlite3.dylib arm64e 167064E4-8F09-34E8-BD7B-DCB59717915A
0x1ad59c000 CoreData arm64e 74B49D9C-EFF1-3207-BFBE-28B5E95E8956
0x205d40000 libxpc.dylib arm64e A0D322A3-D772-3260-9690-71F28737C43C
0x1adbb2000 Security arm64e 2A261700-470E-3DA7-BF55-9D9AE4DB01EE

@sarperdag sarperdag added the bug Something isn't working label Nov 13, 2023
@grdsdev grdsdev self-assigned this Nov 13, 2023
@grdsdev
Copy link
Collaborator

grdsdev commented Nov 13, 2023

Hey @sarperdag thanks for reporting this issue, I'll do some investigation.

@sarperdag
Copy link
Author

Hey @sarperdag thanks for reporting this issue, I'll do some investigation.

many thanks, looking forward to it!

@grdsdev
Copy link
Collaborator

grdsdev commented Nov 13, 2023

Tentative of fixing it in #158

@sarperdag
Copy link
Author

sarperdag commented Nov 13, 2023

Tentative of fixing it in #158

I need this quite urgent as it's crashing quite a lot in my app, can I directly use the [refactor/use-swift-concurrency-extras-lib] branch without waiting it to be merged with main maybe?

@grdsdev
Copy link
Collaborator

grdsdev commented Nov 13, 2023

Sure @sarperdag , feel free to use the branch, and please let me know if that fixes your crash.

@grdsdev
Copy link
Collaborator

grdsdev commented Nov 15, 2023

@sarperdag can you confirm if that fixed your crash? Thank you.

@sarperdag
Copy link
Author

@grdsdev, Apple hasn't approved the build I've submitted yet therefore I can't say anything yet. I'll update when I have more info.

@sarperdag
Copy link
Author

Confirmed the crash is fixed. Thanks a lot! Supabase and the community is amazing!

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

No branches or pull requests

2 participants