Skip to content

Fix EventsExecutor segfault when a task raises an exception - #1718

Open
catplotlib wants to merge 1 commit into
ros2:rollingfrom
catplotlib:fix-events-executor-node-logger-lookup
Open

Fix EventsExecutor segfault when a task raises an exception#1718
catplotlib wants to merge 1 commit into
ros2:rollingfrom
catplotlib:fix-events-executor-node-logger-lookup

Conversation

@catplotlib

Copy link
Copy Markdown

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant