gazebosim / gz-transport

Transport library for component communication based on publication/subscription and service calls.
https://gazebosim.org
Apache License 2.0
29 stars 43 forks source link

Call to exit in NodeShared #53

Closed osrf-migration closed 8 years ago

osrf-migration commented 8 years ago

Original report (archived issue) by Rich Mattes (Bitbucket: richmattes).


We're working on including ignition-transport-1.2.0 in Fedora, and there were only two minor issues that came out of the package review. One of them is that rpmlint found a call to exit() in libignition-transport1.so.1.2.0. rpmlint has this to say about it:

This library package calls exit() or _exit(), probably in a non-fork()
context. Doing so from a library is strongly discouraged - when a library
function calls exit(), it prevents the calling program from handling the
error, reporting it to the user, closing files properly, and cleaning up any
state that the program has. It is preferred for the library to return an
actual error code and let the calling program decide how to handle the
situation.

The exit call is in src/NodeShared.cc, and appears to happen when zeromq throws an exception when being initialized in the NodeShared constructor. Other than passing the exception on to the caller, I can't think of a good way to handle it without moving away from RAII or giving NodeShared some kind of "valid" flag.

osrf-migration commented 8 years ago

Original comment by Carlos Agüero (Bitbucket: caguero, GitHub: caguero).


Thanks for reporting the issue @rmattes. Do you have a deadline for including ignition-transport in Fedora? You could also include the upcoming version 2.x. Multiple versions can be installed side by side. We'll release it in a few days.

osrf-migration commented 8 years ago

Original comment by Rich Mattes (Bitbucket: richmattes).


I'm trying to get gazebo 7 into what will become fedora 25 in a few months, so nothing pressing. The package was approved already, but I can hold off on importing it until 2.0.0 is released.

osrf-migration commented 8 years ago

Original comment by Carlos Agüero (Bitbucket: caguero, GitHub: caguero).


@rmattes, thanks for reporting the issue. See pull request #163.

osrf-migration commented 8 years ago

Original comment by Carlos Agüero (Bitbucket: caguero, GitHub: caguero).


Done in pull request #163.