Fix EventsExecutor segfault when a task raises an exception (#1718)
nodes_ is a pybind11::set, which is not subscriptable. nodes_[0] compiles because object_api::operator[] accepts a py::handle and the literal 0 converts to a null handle, so pybind builds py::str(nullptr) and the process dies in strlen(). The line only runs when a task raises and exactly one node is registered, which is why normal use never reaches it.
Take the element through py::list(nodes_), as the file already does when iterating nodes_ elsewhere.
Three tests in test_executor.py were excluded from EventsExecutor because of this crash; re-enable them.
Signed-off-by: Puja catplotlib@gmail.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
rclpy
ROS Client Library for the Python language.
Documentation
Examples and tutorials for using RCLPy can be found at docs.ros.org. The latest function-level API documentation for RCLPy can be found in our API documentation or via searching for RCLPy on ROS Index.
Building documentation
Documentation can be built for
rclpyusing Sphinx, or accessed online.For building documentation, you need an installation of ROS 2.
Install dependencies
Build
Source your ROS 2 installation, for example:
Build code:
Source workspace and build docs:
Contributions
Please read the ROS 2 Contribution Guide available on docs.ros.org before contributing. If you are looking for a place to start consider checking out our issues tagged
help wantedandgood first issuePull request reviews from new community members are welcomed and encouraged! Please check out the pull request, build it, and run the tests, before reviewing the code. For new feature contributions, please consider filing an issue with theenhancementtag first, so we can discuss it ahead of time. Additional support and contribution resources are listed on our documentation landing page.