thunderbiscuit / padawan-wallet

The bitcoin wallet trainer on Android.
https://padawanwallet.com/
Apache License 2.0
111 stars 49 forks source link

Bug: App crashes when "Generate a new address" is clicked multiple times in Receive Section #286

Closed ptechofficial closed 1 year ago

ptechofficial commented 1 year ago

In Receive section, sometimes even the QR code is not visible. And when it is, generate new address button doesn't work. When clicked multiple times the app crashes.

ptechofficial commented 1 year ago

https://user-images.githubusercontent.com/64535754/229418104-555a1e01-d048-4c73-afb9-597e8948f4a2.mp4

This gives an example of how the app crashes.

yellowHatpro commented 1 year ago

The issue is actually related to #278 , And I am pretty sure the crash is due to ANR. I think that's because of the hard work on the main thread while generating the QR image.

thunderbiscuit commented 1 year ago

Yeah that's a good hunch. @ptechofficial would you be able to paste what's in your logcat when the crash happens?

ptechofficial commented 1 year ago

2023-04-05 01:41:08.053 7866-7866/? E/ANR_LOG: >>> msg's executing time is too long 2023-04-05 01:41:08.053 7866-7866/? E/ANR_LOG: Blocked msg = { when=-9d22h52m18s886ms what=0 target=X.RtA callback=android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0 } , cost = 4862 ms 2023-04-05 01:41:08.053 7866-7866/? E/ANR_LOG: >>>Current msg List is: 2023-04-05 01:41:08.053 7866-7866/? E/ANR_LOG: Current msg <1> = { when=-9d22h52m18s886ms what=0 target=X.RtA callback=android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0 } 2023-04-05 01:41:08.053 7866-7866/? E/ANR_LOG: Current msg <2> = { when=+9m28s784ms what=0 target=android.os.Handler callback=X.0KK } 2023-04-05 01:41:08.053 7866-7866/? E/ANR_LOG: Current msg <3> = { when=+9m30s992ms what=0 target=android.os.Handler callback=X.0KK } 2023-04-05 01:41:08.053 7866-7866/? E/ANR_LOG: Current msg <4> = { when=+5h10m55s236ms what=0 target=android.os.Handler callback=X.0KK } 2023-04-05 01:41:08.053 7866-7866/? E/ANR_LOG: Current msg <5> = { when=+11h11m55s236ms what=0 target=android.os.Handler callback=X.0KK } 2023-04-05 01:41:08.053 7866-7866/? E/ANR_LOG: Current msg <6> = { when=+21h35m55s196ms what=0 target=android.os.Handler callback=X.0KK } 2023-04-05 01:41:08.053 7866-7866/? E/ANR_LOG: >>>CURRENT MSG DUMP OVER<<<

@thunderbiscuit I captured this as soon as the app crashed. Not quite sure what this means.

yellowHatpro commented 1 year ago

Yupp, that's an ANR ( App Not Responding)

darkvoid32 commented 1 year ago

Closing this issue since the underlying cause has been fixed. I don't seem to be getting an ANR now that the work has been moved to a suspended thread. Feel free to reopen if this is still an issue however!