-
Notifications
You must be signed in to change notification settings - Fork 927
fix static destruction order #871
fix static destruction order #871
Conversation
According to C++ standard (http://en.cppreference.com/w/cpp/utility/program/exit) static variables and registered atexit handlers are destroyed/called in reverse order of their occurence. As the singletons TopicManager ... XMLRPCManager are created in ros::start() after having ros::init() registering the atexit handler, they will be destroyed before the call to the atexit handler, which attempted to access them and call their shutdown methods again. Use of global variables should be avoided in general, because their destruction order is determined by library linking. Using singletons the order of destruction can be determined by calling order.
|
CI failure was due to |
|
@ros-pull-request-builder retest this please |
|
@ros-pull-request-builder retest this please |
|
@tfoote buildfarm again failed for an unrelated reason. What's going on there? |
|
Sorry about the noise I was trying to debug why the retriggering wasn't working: ros-infrastructure/ros_buildfarm#332 so I forced the machine offline. It retriggered, but had the same problem. I'll let it run this time. @ros-pull-request-builder retest this please |
|
@ros-pull-request-builder retest please |
|
Check succeeded on CI, but is marked unstable there. Shouldn't it marked succeeded here? |
|
It built, but it did not pass all the tests. http://build.ros.org/job/Kpr__ros_comm__ubuntu_xenial_amd64/147/testReport/ |
fails due to ros/ros_comm#871
|
Hm. I cannot reproduce the buildfarm error locally on my machine. I think somebody of the maintainers should have a look. Interestingly the error message thrown, when switching the published type, is different that on buildfarm, which says: |
fails due to ros/ros_comm#871
fails due to ros/ros_comm#871
…le (#184) * moveit_commander: allow setting of targets from any iterable * disable cleanup test fails due to ros/ros_comm#871
* moveit_commander: allow setting of targets from any iterable * disable cleanup test fails due to ros/ros_comm#871
* moveit_commander: allow setting of targets from any iterable * disable cleanup test fails due to ros/ros_comm#871
|
I can't reproduce the failing test locally either (without modification, see below). But the assertion you posted, the one I see locally, and the one in the build farm log seem to be all identical (and expected). For me as well as you locally the I will trigger the job again just to see if it is actually flaky: @ros-pull-request-builder retest this please |
|
+1 |
|
Thank you for the great patch. |
|
Thanks for merging this. |
|
This can be considered for backport. But I will likely wait some time (until it is released and synced into Kinetic plus acouple of weeks) before doing it. Simply to have enough time to catch potential regressions. |
|
I agree. |
* fix MoveGroup -> MoveGroupInterface in python tests * re-enable test ros/ros_comm#871 is merged and released in Kinetic
* fix MoveGroup -> MoveGroupInterface in python tests * re-enable test ros/ros_comm#871 is merged and released in Kinetic
* fix MoveGroup -> MoveGroupInterface in python tests * re-enable test ros/ros_comm#871 is merged and released in Kinetic
|
@rhaschke @dirk-thomas Can the plan to backport this bug fix to Indigo and Jade be done? That would be great. I am currently using 14.04 and moveit indigo version |
|
There has been no Indigo / Jade release since then. As soon as a new patch release is being made all patches from Kinetic will be considered. This will likely take a few more weeks to happen since we will first focus on another patch release for Kinetic. |
fix static destruction order
This is an attempt to fix #870.
According to C++ standard
staticvariables and registeredatexithandlers are destroyed/called in reverse order of their occurence.The ROS source base seems to assume, that
atexithandlers are called before destruction of anystaticvariables.For example, the singletons
TopicManager...XMLRPCManagerare created inros::start()after havingros::init()registering theatexithandler. Hence, they will be destroyed before the call to theatexithandler, which attempted to access them and call their shutdown methods after destruction.Use of global variables should be avoided in general, because their destruction order is determined by library linking. Using singletons the order of destruction can be determined by calling order.
This bug fix should be applied to Indigo and Jade as well and the source base should be checked for similar issues. I tracked the issue down with AddressSanitizer using
-DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer -O1".