Unexplainable double free or corruption

asked 2019-04-23 05:30:17 -0600

The following code detect the position of the objects using a LIDAR sonsor, it records in a list the objects with the min and max angles of each object. The code works correctly but after a while it stops with double free or corruption.

https://gist.github.com/hdd-robot/15d...

I have debugged the code with GDB, it tells that the program has received a SIGABRT signal and it is stop at line 128 "loop_rate.sleep ();"

Do you have any idea ? Thanks in advance !

edit retag flag offensive close merge delete

Comments

1

This kind of error means there is something wrong with the memory, have you tried debugging using valgrind ?

I tried your code it didn't cause any issue, does it happen all the time after some time or does it depend of the lidar data ?

Delb gravatar image Delb  ( 2019-04-23 07:19:06 -0600 )edit

Thanks for your answer, here you find data test file created with rosbag ros_bag_file To launch rosbag file just do : rosbag play -l laser_scan_2019-04-23-09-58-14.bag

The issue is happen all the time after some time of runing. Thanks.

hdd-robot gravatar image hdd-robot  ( 2019-04-23 07:50:52 -0600 )edit
1

Can we see the output of your node when you pass --cmake-args -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fsanitize=address" to catkin_make (please rm -rf build in your catkin workspace before you run the above).

allenh1 gravatar image allenh1  ( 2019-04-23 10:41:00 -0600 )edit