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

EXC_BAD_ACCESS unhandled errors #2372

Closed
hkeithk opened this issue Mar 20, 2023 · 16 comments
Closed

EXC_BAD_ACCESS unhandled errors #2372

hkeithk opened this issue Mar 20, 2023 · 16 comments
Labels
📱 iOS Related to iOS 🆖 no template Does not fulfill minimal template

Comments

@hkeithk
Copy link

hkeithk commented Mar 20, 2023

Description

EXC_BAD_ACCESS app crash. We're tracking an increase of unhandled errors since upgrading from 10.0.3 to 12.7.3.

Heres a public link to the stack trace: https://solo-6v.sentry.io/share/issue/2fda123fd6b6463e8583ae2b5076819c/

Expected Behavior

We have not been able to reproduce this issue consistently, but continue to see crash reporting on it.

Screenshots
n/a

Environment:

  • react-native-iap: 12.7.3
  • react-native: 0.68.5
  • Platforms (iOS, Android, emulator, simulator, device): IOS devices

To Reproduce
N/a have not been able to consistently reproduce


@andresesfm andresesfm added 📱 iOS Related to iOS 🆖 no template Does not fulfill minimal template labels Mar 22, 2023
@andresesfm
Copy link
Collaborator

Attempt at fixing this: #2375

@andresesfm
Copy link
Collaborator

Released on 12.10.1 let us know if it still happens after updating

@elan
Copy link

elan commented Jul 19, 2023

We're seeing a bunch of these too, using 12.10.5, so I think it's still an issue. Here's the stack to allow better searching for the issue in here.

EXC_BAD_ACCESS specialized Dictionary._Variant.isUniquelyReferenced()
Attempted to dereference garbage pointer 0x8000000000000008.

Thread 2 - (TH_STATE_WAITING)
0 libswiftCore.dylib +0x3ff520   _swift_isUniquelyReferenced_nonNull_native
1 Plexamp +0xde3b4               specialized Dictionary._Variant.isUniquelyReferenced() (<compiler-generated>)
2 Plexamp +0xde7dc               @objc RNIapIos.productsRequest(_:didReceive:) (<compiler-generated>)
3 StoreKit +0x3e84               ___27-[SKProductsRequest _start]_block_invoke_2
4 libdispatch.dylib +0x26a4      __dispatch_call_block_and_release
5 libdispatch.dylib +0x42fc      __dispatch_client_callout
6 libdispatch.dylib +0x7448      __dispatch_queue_override_invoke
7 libdispatch.dylib +0x15be0     __dispatch_root_queue_drain
8 libdispatch.dylib +0x163e8     __dispatch_worker_thread2
9 libsystem_pthread.dylib +0xe10 __pthread_wqthread

@elan
Copy link

elan commented Jul 19, 2023

FWIW, 96.2% of the crashes we see with this are running iOS 17.0, with the remainder being "other" so it would at least appear to be more prevalent on the next iOS release.

[Edit: The rest are on macOS 14, so it would appear to be beta-only.]

@elan
Copy link

elan commented Jul 19, 2023

Another similar but different one on betas:

EXC_BAD_ACCESS: Attempted to dereference garbage pointer 0x8000000000000028.

0  Plexamp +0xf4ec8               specialized __RawDictionaryStorage.find<A>(_:) (<compiler-generated>)
1  Plexamp +0xf6be8               specialized Dictionary._Variant.removeValue(forKey:) (<compiler-generated>)
2  Plexamp +0xdc088               specialized Dictionary.removeValue(forKey:) (<compiler-generated>)
3  Plexamp +0xde700               RNIapIos.productsRequest(_:didReceive:) (RNIapIos.swift:360:9)
4  Plexamp +0xde7dc               @objc RNIapIos.productsRequest(_:didReceive:) (<compiler-generated>)
5  StoreKit +0x3e84               ___27-[SKProductsRequest _start]_block_invoke_2

@jacksonsmith
Copy link

jacksonsmith commented Sep 12, 2023

Same here

react-native-iap@^12.10.5: version "12.10.5"
"react-native": "0.67.1",

Incident Identifier: 64C1410D-7542-4632-9E6D-128B8BDA05F1
CrashReporter Key: aa97c4bcafc8388c7154756f68e17f7dab0afe71
Hardware Model: iPhone14,5
Process: coreModule [10453]
Path: /private/var/containers/Bundle/Application/854DDC27-A766-46A3-951A-FDFA242B5509/coreModule.app/coreModule
Identifier: br.com.xxxxx
Version: 3.8.0 (265)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: br.com.xxxx [3112]

Date/Time: 2023-09-12 15:04:31.0136 -0300
Launch Time: 2023-09-12 14:25:02.4601 -0300
OS Version: iPhone OS 16.6.1 (20G81)
Release Type: User
Baseband Version: 2.80.01
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010
Exception Codes: 0x0000000000000001, 0x0000000000000010
VM Region Info: 0x10 is not in any region. Bytes before following region: 68719476720
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
commpage (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL ...(unallocated)
Triggered by Thread: 0

Kernel Triage:
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x1bb22a820 objc_msgSend + 32
1 libswiftCore.dylib 0x1bbf9443c Dictionary.subscript.getter + 84
2 coreModule 0x100dcc384 RNIapIos.resolvePromises(forKey:value:) + 328

@marf
Copy link

marf commented Nov 1, 2023

Unfortunately, we have those issues too.

@geroale
Copy link

geroale commented Nov 2, 2023

@andresesfm Hello, this issue is still happening even after releasing version 12.11.0.
The problem is still there, this issue should be reopened.

@w3company-leo
Copy link

w3company-leo commented Dec 5, 2023

still happen in 12.11.0

@arthurgeron

@arthurgeron-work
Copy link

arthurgeron-work commented Jan 7, 2024

still happen in 12.11.0

@arthurgeron

My fix hasn't been merged nor released

@openpathgit
Copy link

Could we please have someone help to get the fix merged?

@arthurgeron
Copy link
Contributor

Could we please have someone help to get the fix merged?

I'd appreciate that!
Meanwhile, you can just copy/paste the changed files in your project's node_modules/react-native-iap and persist the changes with patch package.

@openpathgit
Copy link

@arthurgeron do you think this pr would fix this crash? its also coming on resolvePromises, but from it seems like a pending transaction

Thread 0 name:
Thread 0 Crashed:
0 KidneyDiet 0x0000000100e9faa4 specialized Dictionary.subscript.getter + 0 (:0)
1 KidneyDiet 0x0000000100e9faa4 RNIapIos.resolvePromises(forKey:value:) + 92 (RNIapIos.swift:90)
2 KidneyDiet 0x0000000100ea449c closure #1 in RNIapIos.purchaseProcess(:) + 164 (RNIapIos.swift:522)
3 KidneyDiet 0x0000000100ea531c specialized closure #1 in RNIapIos.getPurchaseData(
:withBlock:) + 1852 (RNIapIos.swift:797)
4 KidneyDiet 0x0000000100ea5df4 specialized closure #1 in RNIapIos.getPurchaseData(:withBlock:) + 24 (RNIapIos.swift:813)
5 KidneyDiet 0x0000000100ea5df4 RNIapIos.purchaseProcess(
:) + 24 (:0)
6 KidneyDiet 0x0000000100ea5df4 specialized RNIapIos.paymentQueue(:updatedTransactions:) + 2708
7 KidneyDiet 0x0000000100ea48ac @objc RNIapIos.paymentQueue(
:updatedTransactions:) + 128
8 StoreKit 0x00000001c5f3ba5c __48-[SKPaymentQueue _updatedTransactions:restored:]_block_invoke_2 + 52 (SKPaymentQueue.m:1471)
9 libdispatch.dylib 0x00000001a56406a8 _dispatch_call_block_and_release + 32 (init.c:1530)
10 libdispatch.dylib 0x00000001a5642300 _dispatch_client_callout + 20 (object.m:561)
11 libdispatch.dylib 0x00000001a5650998 _dispatch_main_queue_drain + 984 (queue.c:7813)
12 libdispatch.dylib 0x00000001a56505b0 _dispatch_main_queue_callback_4CF + 44 (queue.c:7973)
13 CoreFoundation 0x000000019d67cf9c CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16 (CFRunLoop.c:1780)
14 CoreFoundation 0x000000019d679ca8 __CFRunLoopRun + 1996 (CFRunLoop.c:3149)
15 CoreFoundation 0x000000019d6793f8 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
16 GraphicsServices 0x00000001e0c074f8 GSEventRunModal + 164 (GSEvent.c:2196)
17 UIKitCore 0x000000019fa9f8a0 -[UIApplication _run] + 888 (UIApplication.m:3685)
18 UIKitCore 0x000000019fa9eedc UIApplicationMain + 340 (UIApplication.m:5270)
19 KidneyDiet 0x0000000100cbf24c main + 80 (main.m:7)
20 dyld 0x00000001c03cedcc start + 2240 (dyldMain.cpp:1269)

@openpathgit
Copy link

@arthurgeron do you think this pr would fix this crash? its also coming on resolvePromises, but from it seems like a pending transaction

Thread 0 name: Thread 0 Crashed: 0 KidneyDiet 0x0000000100e9faa4 specialized Dictionary.subscript.getter + 0 (:0) 1 KidneyDiet 0x0000000100e9faa4 RNIapIos.resolvePromises(forKey:value:) + 92 (RNIapIos.swift:90) 2 KidneyDiet 0x0000000100ea449c closure #1 in RNIapIos.purchaseProcess(:) + 164 (RNIapIos.swift:522) 3 KidneyDiet 0x0000000100ea531c specialized closure #1 in RNIapIos.getPurchaseData(:withBlock:) + 1852 (RNIapIos.swift:797) 4 KidneyDiet 0x0000000100ea5df4 specialized closure #1 in RNIapIos.getPurchaseData(:withBlock:) + 24 (RNIapIos.swift:813) 5 KidneyDiet 0x0000000100ea5df4 RNIapIos.purchaseProcess(:) + 24 (:0) 6 KidneyDiet 0x0000000100ea5df4 specialized RNIapIos.paymentQueue(:updatedTransactions:) + 2708 7 KidneyDiet 0x0000000100ea48ac @objc RNIapIos.paymentQueue(:updatedTransactions:) + 128 8 StoreKit 0x00000001c5f3ba5c __48-[SKPaymentQueue _updatedTransactions:restored:]_block_invoke_2 + 52 (SKPaymentQueue.m:1471) 9 libdispatch.dylib 0x00000001a56406a8 _dispatch_call_block_and_release + 32 (init.c:1530) 10 libdispatch.dylib 0x00000001a5642300 _dispatch_client_callout + 20 (object.m:561) 11 libdispatch.dylib 0x00000001a5650998 _dispatch_main_queue_drain + 984 (queue.c:7813) 12 libdispatch.dylib 0x00000001a56505b0 _dispatch_main_queue_callback_4CF + 44 (queue.c:7973) 13 CoreFoundation 0x000000019d67cf9c CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16 (CFRunLoop.c:1780) 14 CoreFoundation 0x000000019d679ca8 __CFRunLoopRun + 1996 (CFRunLoop.c:3149) 15 CoreFoundation 0x000000019d6793f8 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420) 16 GraphicsServices 0x00000001e0c074f8 GSEventRunModal + 164 (GSEvent.c:2196) 17 UIKitCore 0x000000019fa9f8a0 -[UIApplication _run] + 888 (UIApplication.m:3685) 18 UIKitCore 0x000000019fa9eedc UIApplicationMain + 340 (UIApplication.m:5270) 19 KidneyDiet 0x0000000100cbf24c main + 80 (main.m:7) 20 dyld 0x00000001c03cedcc start + 2240 (dyldMain.cpp:1269)

Its coming in while the app is running, not from a react native request to get history or to purchase. It says i have 55 products and 1 is pending

Apr 4 13:56:35 Richards-iPhone-3 storekitd[614] : [62AAAA6F]: Found 55 products in receipt with ID monthly_subscription
Apr 4 13:56:35 Richards-iPhone-3 storekitd[614] : [62AAAA6F] Found 1 transactions in pending queue

@arthurgeron
Copy link
Contributor

@openpathgit Transaction might mean something else, like an unfinished or ongoing purchase.
Looking at the log, it seems the crash occurred when calling subscript on a Dictionary, so it might have something to do or could be an entirely different problem. Just in case, I'd make sure that all calls made from the IAP's module are only being made once at a time, to avoid racing conditions.
Either way, the only way that you'll know for sure is by testing it locally!

@hkeithk
Copy link
Author

hkeithk commented Apr 5, 2024

Hi @hyochan , this PR was closed a few months back as we had a potential fix.

Since it seems there are several other reports of similar issues, I was wondering if this could be re-opened?

Also it seems @arthurgeron has a proposed fix. Could you please take a look and provide some insight on what would be needed to push this through?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📱 iOS Related to iOS 🆖 no template Does not fulfill minimal template
Projects
None yet
Development

No branches or pull requests

10 participants