Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent segfault from swri::Subscriber during initial bagfile playback #547

Closed
jgassaway opened this issue Jul 22, 2019 · 1 comment · Fixed by #735
Closed

Prevent segfault from swri::Subscriber during initial bagfile playback #547

jgassaway opened this issue Jul 22, 2019 · 1 comment · Fixed by #735

Comments

@jgassaway
Copy link
Contributor

When using a swri:Subscriber which is calculating msg latency diagnostics, a node will segfault when this set of operations is performed:

  1. Start a new roscore
  2. Set the rosparam /use_sim_time to true
  3. Run the node with a swri::Subscriber
  4. Start a bagfile (outputting clock) in paused mode ($ rosbag play --clock --pause)

In this case, the node will immediately crash because of a std::runtime_error where "Duration is out of dual 32-bit range"

This appears to come from line 84 of swri_roscpp/include/swri_roscpp/subscriber_impl.h in the case where now is at time zero (sec: 0, nsec: 0), but stamp is at some non-zero time. Most likely, this is caused by receiving an initial message with a stamp before receiving the /clock msg that updates ros::Time::now().

@danthony06
Copy link
Contributor

Fixed via #734

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 a pull request may close this issue.

2 participants