Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.
This repository was archived by the owner on May 31, 2025. It is now read-only.

XmlRpcValue is TypeInvalid returned from master::execute("registerSubscriber", ...) #836

@mikepurvis

Description

@mikepurvis

We're seeing a bunch of crashes in our robots which take this form:

../../../../../ros-comm-d54e9be3421af71b70fc6b60a3bf916e779b43dc/clients/roscpp/src/libros/node_handle.cpp in ros::NodeHandle::subscribe at line 331

../../../../../ros-comm-d54e9be3421af71b70fc6b60a3bf916e779b43dc/clients/roscpp/src/libros/topic_manager.cpp in ros::TopicManager::subscribe at line 277

../../../../../ros-comm-d54e9be3421af71b70fc6b60a3bf916e779b43dc/clients/roscpp/src/libros/topic_manager.cpp in ros::TopicManager::registerSubscriber at line 485

../../../../../ros-comm-d54e9be3421af71b70fc6b60a3bf916e779b43dc/utilities/xmlrpcpp/src/XmlRpcValue.cpp in XmlRpc::XmlRpcValue::size at line 205

/usr/lib/x86_64-linux-gnu/libstdc++.so.6 in __cxa_throw ()

/usr/lib/x86_64-linux-gnu/libstdc++.so.6 in std::terminate() ()

/usr/lib/x86_64-linux-gnu/libstdc++.so.6 in ?? ()

/usr/lib/x86_64-linux-gnu/libstdc++.so.6 in __gnu_cxx::__verbose_terminate_handler() ()

abort.c in __GI_abort at line 89

../nptl/sysdeps/unix/sysv/linux/raise.c in __GI_raise at line 56

The line in question is here:

throw XmlRpcException("type error");

The cause is this logic which calls the master RPC without checking for the possibility of a TypeInvalid for the payload object: https://github.com/ros/ros_comm/blob/d54e9be3421af71b70fc6b60a3bf916e779b43dc/clients/roscpp/src/libros/topic_manager.cpp#L479-491

The simple fix is to just check for invalid and return false, similar to when master::execute itself returns false. However, my concern about this is that I don't really understand the underlying conditions which cause the RPC to fail. Should it be retried? Is there logic somewhere which already does this? AFAIK, the roscpp API makes no expectation of users to check for and retry subscriptions at the application layer.

FYI @jasonimercer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions