Apparently the problem was related to an error in the documentation I was using. In particular RCCHECK(std_msgs__msg__Float64__init(&sub_msg))
was the line triggering the error.
My code was calling the RCCHECK macro on a function that returns a bool, not an rcl_ret_t. Since true != RCL_RET_OK (which is 0)
, it instantly trip the error handler.
This error also apply to all the other type publisher initializers.