-
Notifications
You must be signed in to change notification settings - Fork 45
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
OOM crash in ~30 seconds after Terminal.initTerminal invocation #436
Comments
We have seen it at times with BT, but thought it was a dependency issue, as after updating some of the other packages, it seemed to go away. This thread from the tape2 repo seems to indicate is a multi-thread-contention issue, I think? So why it comes and goes between builds.. I'm not sure. @SergeyVinyar Have you succeeded in creating a simpler repro app? |
That also fits with #434, as we are calling |
No, it's sporadical and also an app needs a token from the backend to make a payment (and it looks like without a payment we don't get into this issue). I cannot just make a small app that shows the bug. |
Something like:
and then:
|
That sounds like a good idea... I'll try that too, as soon as i get some time. I'll post any updates to my issue thread, and I'll watch for anything from you in case you get to it first. |
Hi @SergeyVinyar , we rolled out a fix to mitigate this problem in |
Hi @ugochukwu-stripe, thank you a lot. I'll check |
We've done smoke testing. Everything works. Thank you! |
Summary
For our unpublished yet app we've upgraded the SDK from 2.16.0-b1 to 3.2.1 and started registering crashes in ~30 seconds after
Terminal.initTerminal(...)
invocation with a stacktraceOften we can make a successful test payment with a card reader but sometimes the app falls into a loop:
Terminal.initTerminal(...)
inApplication.onCreate
And it repeats until the app is removed and installed again.
All exceptions in the loop have the same amount of bytes for allocation (1445090328 in this example).
Code to reproduce
Unfortunately, we couldn't find a scenario to reproduce it.
Android version
11, 12
Impacted devices (Android devices or readers)
Galaxy Tab A7 Lite
Galaxy Tab S6 Lite
SDK version
3.2.1
Also when we got into this crash loop, we tried to downgrade the version to 3.0.0 without removing the app from the device, and it still crashed.
Other information
I'm sure this is the same problem as in #434 but in our case we didn't use NFC. Galaxy Tab A7 Lite doesn't have an NFC reader at all.
I suspect the reason is that https://github.com/square/tape/blob/master/tape/src/main/java/com/squareup/tape2/QueueFile.java is not thread safe but the stacktrace includes coroutines which may freely change threads for each suspend method. And the temporary file that QueueFile creates just gets corrupted sometimes.
We invoke:
Terminal.initTerminal(...)
on a default dispatcherterminal.discoverReaders(...)
on a default dispatcher and sometimes on an Android main threadterminal.connectBluetoothReader(...)
on an Android main thread (a user clicks "Connect")terminalService.collectPayment(...)
on a default dispatcherThe text was updated successfully, but these errors were encountered: