ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

The the source of the exception is almost certainly right here: https://github.com/lagadic/vrep_ros_bridge/blob/a4e10d64a2dff85407a8c4e75fa2e669bcdb7c59/manipulator_handler/src/ManipulatorHandler.cpp#L394

_lastPrintedMsg = ros::Time(-1.0);

(and possibly there are other instances of bad time initialization, and there's also initializing a ros::Duration with an uninitialized double will sometimes result in a Duration is out of dual 32-bit range depending on if the uninitialized memory happens to be an acceptable Duration or not):

Here's a simple example https://github.com/lucasw/timer_test/blob/master/src/bad_time.cpp

#include <iostream>
#include <ros/ros.h>

int main()
{
  const auto cur = ros::Time(-1);
/**
 * this will be the result of the above
terminate called after throwing an instance of 'std::runtime_error'
  what():  Time is out of dual 32-bit range
Aborted (core dumped)
*/
  std::cout << cur << std::endl;
  const double sec = cur.toSec();
  std::cout << sec << std::endl;
}

For reference the exception is thrown from here (though for some cases are some similarly phrased exceptions so it isn't always clear):

https://github.com/ros/roscpp_core/blob/kinetic-devel/rostime/include/ros/impl/time.h#L80

Maybe a few years and ros versions ago ros::Time(-1) was an unofficial sentinel value? Then it started throwing exceptions but the people encountering the exceptions and the rosccp_core maintainers were too many degrees separated to realize any of this.

The the source of the exception is almost certainly right here: https://github.com/lagadic/vrep_ros_bridge/blob/a4e10d64a2dff85407a8c4e75fa2e669bcdb7c59/manipulator_handler/src/ManipulatorHandler.cpp#L394

_lastPrintedMsg = ros::Time(-1.0);

(and possibly there are other instances of bad time initialization, initialization in the same package, and there's also an issue where initializing a ros::Duration with an uninitialized double will sometimes result in a Duration is out of dual 32-bit range depending on if the uninitialized memory happens to be an acceptable Duration or not):not https://github.com/ros-controls/ros_controllers/pull/577):

Here's a simple example https://github.com/lucasw/timer_test/blob/master/src/bad_time.cpp

#include <iostream>
#include <ros/ros.h>

int main()
{
  const auto cur = ros::Time(-1);
/**
 * this will be the result of the above
terminate called after throwing an instance of 'std::runtime_error'
  what():  Time is out of dual 32-bit range
Aborted (core dumped)
*/
  std::cout << cur << std::endl;
  const double sec = cur.toSec();
  std::cout << sec << std::endl;
}

For reference the exception is thrown from here (though for some cases are some similarly phrased exceptions so it isn't always clear):

https://github.com/ros/roscpp_core/blob/kinetic-devel/rostime/include/ros/impl/time.h#L80

Maybe a few years and ros versions ago ros::Time(-1) was an unofficial sentinel value? Then it started throwing exceptions but the people encountering the exceptions and the rosccp_core maintainers were too many degrees separated to realize any of this.

The the source of the exception is almost certainly right here: here (which dates from 2014): https://github.com/lagadic/vrep_ros_bridge/blob/a4e10d64a2dff85407a8c4e75fa2e669bcdb7c59/manipulator_handler/src/ManipulatorHandler.cpp#L394

_lastPrintedMsg = ros::Time(-1.0);

(and possibly there are other instances of bad time initialization in the same package, and there's also an issue where initializing a ros::Duration with an uninitialized double will sometimes result in a Duration is out of dual 32-bit range depending on if the uninitialized memory happens to be an acceptable Duration or not https://github.com/ros-controls/ros_controllers/pull/577):

Here's a simple example https://github.com/lucasw/timer_test/blob/master/src/bad_time.cpp

#include <iostream>
#include <ros/ros.h>

int main()
{
  const auto cur = ros::Time(-1);
/**
 * this will be the result of the above
terminate called after throwing an instance of 'std::runtime_error'
  what():  Time is out of dual 32-bit range
Aborted (core dumped)
*/
  std::cout << cur << std::endl;
  const double sec = cur.toSec();
  std::cout << sec << std::endl;
}

For reference the exception is thrown from here (though for some cases there are some similarly phrased exceptions so it isn't always clear):

https://github.com/ros/roscpp_core/blob/kinetic-devel/rostime/include/ros/impl/time.h#L80

Maybe a few years and ros versions ago ros::Time(-1) was an unofficial sentinel value? Then it started throwing exceptions but the people encountering the exceptions and the rosccp_core maintainers were too many degrees separated to realize any of this.

The the source of the exception is almost certainly right here (which dates from 2014): https://github.com/lagadic/vrep_ros_bridge/blob/a4e10d64a2dff85407a8c4e75fa2e669bcdb7c59/manipulator_handler/src/ManipulatorHandler.cpp#L394

_lastPrintedMsg = ros::Time(-1.0);

(and possibly there are other instances of bad time initialization in the same package, and there's also an issue where initializing a ros::Duration with an uninitialized double will sometimes result in a Duration is out of dual 32-bit range depending on if the uninitialized memory happens to be an acceptable Duration or not https://github.com/ros-controls/ros_controllers/pull/577):

Here's a simple example https://github.com/lucasw/timer_test/blob/master/src/bad_time.cpp

#include <iostream>
#include <ros/ros.h>

int main()
{
  const auto cur = ros::Time(-1);
/**
 * this will be the result of the above
terminate called after throwing an instance of 'std::runtime_error'
  what():  Time is out of dual 32-bit range
Aborted (core dumped)
*/
  std::cout << cur << std::endl;
  const double sec = cur.toSec();
  std::cout << sec << std::endl;
}

For reference the exception is thrown from here (though for some cases there are some similarly phrased exceptions so it isn't always clear):

https://github.com/ros/roscpp_core/blob/kinetic-devel/rostime/include/ros/impl/time.h#L80

Maybe a few years and ros versions ago ros::Time(-1) was an unofficial sentinel value? Then it started throwing exceptions but the people encountering the exceptions and the rosccp_core maintainers were too many degrees separated to realize any of this.

this. Or it was cleaned up in major packages that were being actively maintained, but of little time bombs are lying around elsewhere.

The the source of the exception is almost certainly right here (which dates from 2014): https://github.com/lagadic/vrep_ros_bridge/blob/a4e10d64a2dff85407a8c4e75fa2e669bcdb7c59/manipulator_handler/src/ManipulatorHandler.cpp#L394

_lastPrintedMsg = ros::Time(-1.0);

(and possibly there are other instances of bad time initialization in the same package, and there's also an issue where initializing a ros::Duration with an uninitialized double will sometimes result in a Duration is out of dual 32-bit range depending on if the uninitialized memory happens to be an acceptable Duration or not https://github.com/ros-controls/ros_controllers/pull/577):

Here's a simple example https://github.com/lucasw/timer_test/blob/master/src/bad_time.cpp

#include <iostream>
#include <ros/ros.h>

int main()
{
  const auto cur = ros::Time(-1);
/**
 * this will be the result of the above
terminate called after throwing an instance of 'std::runtime_error'
  what():  Time is out of dual 32-bit range
Aborted (core dumped)
*/
  std::cout << cur << std::endl;
  const double sec = cur.toSec();
  std::cout << sec << std::endl;
}

For reference the exception is thrown from here (though for some cases there are some similarly phrased exceptions so it isn't always clear):

https://github.com/ros/roscpp_core/blob/kinetic-devel/rostime/include/ros/impl/time.h#L80

Maybe a few years and ros versions ago ros::Time(-1) was an unofficial sentinel value? Then it started throwing exceptions but the people encountering the exceptions and the rosccp_core maintainers were too many degrees separated to realize any of this. Or it was cleaned up in major packages that were being actively maintained, but of little time bombs are lying around elsewhere.

The the source of the exception is almost certainly right here (which dates from 2014): https://github.com/lagadic/vrep_ros_bridge/blob/a4e10d64a2dff85407a8c4e75fa2e669bcdb7c59/manipulator_handler/src/ManipulatorHandler.cpp#L394

_lastPrintedMsg = ros::Time(-1.0);

(and possibly there are other instances of bad time initialization in the same package, and there's also an issue where initializing a ros::Duration with an uninitialized double will sometimes result in a Duration is out of dual 32-bit range depending on if the uninitialized memory happens to be an acceptable Duration or not https://github.com/ros-controls/ros_controllers/pull/577):

Here's a simple example https://github.com/lucasw/timer_test/blob/master/src/bad_time.cpp

#include <iostream>
#include <ros/ros.h>

int main()
{
  const auto cur = ros::Time(-1);
/**
 * this will be the result of the above
terminate called after throwing an instance of 'std::runtime_error'
  what():  Time is out of dual 32-bit range
Aborted (core dumped)
*/
  std::cout << cur << std::endl;
  const double sec = cur.toSec();
  std::cout << sec << std::endl;
}

For reference the exception is thrown from here (though for some cases there are some similarly phrased exceptions so it isn't always clear):

https://github.com/ros/roscpp_core/blob/kinetic-devel/rostime/include/ros/impl/time.h#L80

Maybe a few years and ros versions ago ros::Time(-1) was an unofficial sentinel value? Then it started throwing exceptions but the people encountering the exceptions and the rosccp_core maintainers were too many degrees separated to realize any of this. Or it was cleaned up in major packages that were being actively maintained, but little time bombs are lying around elsewhere.

Ideally something could be done to make it a compiler error (or we should all move to rust...).