micro-ROS / rmw_microxrcedds

RMW implementation using Micro XRCE-DDS middleware.
Apache License 2.0
32 stars 25 forks source link

rmw_uros_ping_agent can cause exception when micro-ROS has not been initialized (MULTITHREAD Feature on) #203

Closed wonjae-song closed 2 years ago

wonjae-song commented 2 years ago

Steps to reproduce the issue

option : -DUCLIENT_PROFILE_MULTITHREAD=On -DPLATFORM_NAME_FREERTOS step 1> initialize custom transport step 2> call "rmw_uros_ping_agent" to check if microros agent is available step 3> initialize micro-ros (call rclc_support_init, rclc_node_init_default and so on)

Expected behavior

wait for agent to be ready at step 2 so I can initialize micro-ros after success to ping

Actual behavior

exception is triggered at step2. UXR_LOCK(&session_memory.mutex); //<--- session_memory.mutex seems not to be initialized

Additional information

according to API description, rmw_uros_ping_agent can be used even when the micro-ROS context has not yet been initialized, which is useful to test the connection before trying to connect to the Agent

pablogs9 commented 2 years ago

Working on this

pablogs9 commented 2 years ago

Related: https://github.com/micro-ROS/rmw_microxrcedds/pull/205