-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[BUG] [Android] crash happens when device reboot #30624
Comments
is it crash happening in android controller? |
Appens when call this one in my ChipClient:
|
@yunhanw-google Following @MatteoSomensi issue, when a matter device falls out of network reachability the chip library try to resend the command. For example if I try to obtain a device pointer or read/write a cluster attribute. The library execute some retries and then throws and exception. Such exception is not catchable in any way and the app crashes. Here a detailed log of an attempt to read this attribute: readTemperatureSetpointHoldDurationAttribute Is there any way to catch those crash in android app? 09:07:26.127 E Failed to Send CHIP MessageCounter:180467474 on exchange 63959i sendCount: 4 max retries: 4 |
sounds like we need to catch exception in OnError function in android chip-tool. private val reportCallback = Line 67 in 4676d27
Line 212 in 4676d27
Line 33 in 4676d27
|
@yunhanw-google I think that exceptions need to be exposed to java/kotlin. |
@pgatti86 I tried android chip-tool and do the successful pairing, then power-off the accessory, do read for basic info cluster, the exchange manager retries counter 4, then onConnectionFailure is called. It seems it is working correctly. 01-17 15:05:13.203 29951 29999 D EM : Retransmitting MessageCounter:137035299 on exchange 21526i Send Cnt 4 |
@pgatti86 From your log, it seems the code goes from
If you can consistently reproduce this issue, and put additional logging and find the actual error point, then we can put up the right fix on it. thanks |
I confirm that I can consistently reproduce this issue. Here the exception details: Failed to Send CHIP MessageCounter:77699762 on exchange 30421i sendCount: 4 max retries: 4 |
@pgatti86 what is the commit Id are you using to reproduce this issue? I am using latest in master, and still cannot reproduce it. I am just using android-chip-tool, power off my switch, then write the label using basic cluster fragment in UI. |
@yunhanw-google I have checked out the tagged version 1.2.0.1 |
@yunhanw-google After your suggestion I have checked out the master branch. Same result. When I write an attribute with my device turned off an exception is thrown. Here some logs: Failed to Send CHIP MessageCounter:70053300 on exchange 29799i sendCount: 4 max retries: 4 Is there anything else I can do to help you? |
@pgatti86 are you using android chip-tool, if not, can you trying the latest android chip-tool, if still reproduced, please let me the detailed step. thanks |
@pgatti86 |
@joonhaengHeo and I both tried several times using master branch and v1.2.0.1 branch, we both cannot reproduce it. Maybe you can try android chip-tool using your scenario, if that works, then maybe something wrong on your application? thanks @pgatti86 |
@pgatti86 any update on it? thanks |
@yunhanw-google
|
@pgatti86 thanks for the reply. May i know which exception is captured, and further lead to the above issue? How do you fix this issue? |
@yunhanw-google the issue was fixed resuming the continuation without the exception, even into the onError callback. |
I see, thanks for clarification. |
Reproduction steps
When device reboot and the application tries to send a message to the ChipClient after a number of failed attempts a native exception is thrown which causes the application to crash.
Bug prevalence
systematic
GitHub hash of the SDK that was being used
181b0cb
Platform
android
Failed to Send CHIP MessageCounter:172130281 on exchange 33460i sendCount: 4 max retries: 4
Time out! failed to receive report data from Exchange: 33460i
A java_vm_ext.cc:591] JNI DETECTED ERROR IN APPLICATION: JNI GetObjectClass called with pending exception java.lang.NullPointerException:
java_vm_ext.cc:591] (Throwable with no stack trace)
java_vm_ext.cc:591]
java_vm_ext.cc:591] in call to GetObjectClass
A runtime.cc:691] Runtime aborting...
The text was updated successfully, but these errors were encountered: