This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Crash when handling Config Node Reset when a reliable transfer is ongoing

If a reliable mesh transfer is ongoing the node will crash with a mesh assert at access_reliable.c:373, in access_reliable_cancel_all().

This happens because access_clear() calls access_state_clear() and then access_reliable_cancel_all().

The access_state_clear() will erase m_model_pool and access_reliable_cancel_all() will cancel all ongoing transfers which holds a handle into m_model_pool which is now invalid and thus access_model_p_args_get() returns NRF_ERROR_NOT_FOUND triggering the assert.

Swapping the calls make things work better.

diff --git a/mesh/access/src/access.c b/mesh/access/src/access.c
index 81e1492..153b2fe 100644
--- a/mesh/access/src/access.c
+++ b/mesh/access/src/access.c
@@ -1083,8 +1083,8 @@ uint32_t access_packet_tx(access_model_handle_t handle,
 /* ********** Public API ********** */
 void access_clear(void)
 {
-    access_state_clear();
     access_reliable_cancel_all();
+    access_state_clear();
     access_flash_config_clear();
 }
 

I'm using SDK For Mesh v3.1.0.

Thanks.

Parents Reply Children
No Data
Related