Skip to content

[Bug] Reconnection on ThreadX causes crash due to memset() #1053

@ben5049

Description

@ben5049

Describe the bug

ThreadX's threads, mutexes etc contain pointers to the next and previous thread, mutex etc, forming a linked list. When Zenoh Pico attempts to reconnect it uses memset() to zero these structs rather than deleting them properly. This leads to ThreadX attempting to dereference zeroed memory when going through the linked list, causing the program to crash. An example of this is at the start of the function _z_unicast_transport_create.

To reproduce

  1. Run any ThreadX example with Z_FEATURE_AUTO_RECONNECT = 1
  2. Start an instance of zenohd
  3. Stop zenohd
  4. Start zenohd again
  5. Zenoh pico will crash due to ThreadX attempting to dereference uninitialised memory

System info

  • Platform: STM32H573, ThreadX, NetXduo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions