esp-mesh-lite icon indicating copy to clipboard operation
esp-mesh-lite copied to clipboard

Crash while accessing the mesh node details from the nodelist object retuned by esp_mesh_lite_get_nodes_list (AEGHB-1311)

Open vijay-563 opened this issue 5 months ago • 1 comments

Checklist

  • [x] Checked the issue tracker for similar issues to ensure this is not a duplicate
  • [x] Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • [x] Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

rarely

Expected behavior

we have a method 'esp_mesh_lite_get_nodes_list' to the current mesh node list but this list is updated in 'esp_mesh_lite.c' using the mutex node_info_mutex. But outside this we don't have a provision to access it. So during accessing the nodes retuned by 'esp_mesh_lite_get_nodes_list' method, the node list might get updated (added/deleted) and causing the crash while accessing it. Is there any way to copy the node list or access the nodelist with thread safe. I use the CONFIG_MESH_LITE_REPORT_INTERVAL as 5 secs

Actual behavior (suspected bug)

I don't see any option to access the nodelist returned by esp_mesh_lite_get_nodes_list() threadsafe.

Error logs or terminal output


Steps to reproduce the behavior

Enable esp mesh lite and change the CONFIG_MESH_LITE_REPORT_INTERVAL value to 5 (from default 300). Print the nodelist details from the object returned by esp_mesh_lite_get_nodes_list() Crash happens while accessing the mac address of one of the nodes from the node list.

Project release version

v1.2.0

System architecture

other (details in Additional context)

Operating system

Linux

Operating system version

FreeRTOS

Shell

ZSH

Additional context

We use ESP32 S3 (ESP IDF v5.4.1)

vijay-563 avatar Nov 19 '25 07:11 vijay-563

Under normal circumstances, for safety reasons, the esp_mesh_lite_get_nodes_list API should return a copy rather than the original variable.

In the release/v1.0 version, this part of the operation is not fully implemented. You can manually modify the logic in mesh_lite/src/esp_mesh_lite.c.

tswen avatar Nov 25 '25 03:11 tswen