code-debug icon indicating copy to clipboard operation
code-debug copied to clipboard

The debugging thread received SIGABRT when print a boost::shared_ptr variable.

Open brillywu opened this issue 5 years ago • 0 comments

Here is the source code:


typedef ::sensor_msgs::PointCloud2_<std::allocator<void> > PointCloud2;
  typedef boost::shared_ptr< ::sensor_msgs::PointCloud2_<ContainerAllocator> > Ptr;
  typedef boost::shared_ptr< ::sensor_msgs::PointCloud2_<ContainerAllocator> const> ConstPtr;


void RayGroundFilter::CloudCallback(const sensor_msgs::PointCloud2ConstPtr& in_sensor_cloud)
{
  health_checker_ptr_->NODE_ACTIVATE();
  health_checker_ptr_->CHECK_RATE("topic_rate_points_raw_slow", 8, 5, 1, "topic points_raw subscribe rate slow.");

  sensor_msgs::PointCloud2::Ptr trans_sensor_cloud(new sensor_msgs::PointCloud2);
  const bool succeeded = TransformPointCloud(base_frame_, in_sensor_cloud, trans_sensor_cloud);
  if (!succeeded)
  {
    ROS_ERROR_STREAM_THROTTLE(10, "Failed transform from " << base_frame_ << " to "
                                                           << in_sensor_cloud->header.frame_id);
    return;
  }
.....
}

when break points hit, I move mouse to "trans_sensor_cloud", sometimes, it works well, sometimes it lets thread abort

Thread 1 "ray_ground_filt" hit Breakpoint 5, RayGroundFilter::CloudCallback (this=0x7ffeac7e5c00, in_sensor_cloud=...) at /home/brillywu/01.git/github/Autoware/autoware.ai/src/autoware/core_perception/points_preprocessor/nodes/ray_ground_filter/ray_ground_filter.cpp:333
333	  if (!succeeded)
Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)

Thread 1 "ray_ground_filt" received signal SIGABRT, Aborted.
0x00007f42aa381fb7 in raise () from /lib/x86_64-linux-gnu/libc.so.6
Stopping due to fatal error: AggregateException: One or more errors occurred.
  • [*] If you are using gdb
    • [*] gdb --version >= 7.7.1
    • [ ] it works on the command line with gdb
    • [*] cwd and target are properly set
  • [ ] If you are using lldb
    • [ ] lldb --version >= 3.7.1
    • [ ] it works on the command line with lldb-mi
    • [ ] cwd and target are properly set

Screenshots are helpful but not required

brillywu avatar Nov 11 '20 04:11 brillywu