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

Segmentation Fault in Hector Slam #23

Closed
nwotero opened this issue Aug 6, 2015 · 1 comment
Closed

Segmentation Fault in Hector Slam #23

nwotero opened this issue Aug 6, 2015 · 1 comment

Comments

@nwotero
Copy link

nwotero commented Aug 6, 2015

When I rotate my base 90 degrees, Hector Slam consistently seg faults. According to GDB, this segmentation fault occurs in GridMapCacheArray::containsCachedData(int, float&). From the source, it seems that Line 82 is the culprit: const CachedMapElement& elem (cacheArray[index]);

This is a really easy patch, but I am unsure if it points to a more serious underlying problem.

If this is because of a race condition, a simple if statement would only be covering up the problem.

@nwotero
Copy link
Author

nwotero commented Aug 6, 2015

Full Backtrace:

#0 0x00000000005df7db in GridMapCacheArray::containsCachedData(int, float&) ()
#1 0x0000000000608b5e in hectorslam::OccGridMapUtil<hectorslam::OccGridMapBase<LogOddsCell, GridMapLogOddsFunctions>, GridMapCacheArray>::interpMapValueWithDerivatives(Eigen::Matrix<float, 2, 1, 0, 2, 1> const&) ()
#2 0x00000000005fe779 in hectorslam::OccGridMapUtil<hectorslam::OccGridMapBase<LogOddsCell, GridMapLogOddsFunctions>, GridMapCacheArray>::getCompleteHessianDerivs(Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, hectorslam::DataPointContainer<Eigen::Matrix<float, 2, 1, 0, 2, 1> > const&, Eigen::Matrix<float, 3, 3, 0, 3, 3>&, Eigen::Matrix<float, 3, 1, 0, 3, 1>&) ()
#3 0x00000000005f3475 in hectorslam::ScanMatcher<hectorslam::OccGridMapUtilConfig<hectorslam::OccGridMapBase<LogOddsCell, GridMapLogOddsFunctions> > >::estimateTransformationLogLh(Eigen::Matrix<float, 3, 1, 0, 3, 1>&, hectorslam::OccGridMapUtilConfig<hectorslam::OccGridMapBase<LogOddsCell, GridMapLogOddsFunctions> >&, hectorslam::DataPointContainer<Eigen::Matrix<float, 2, 1, 0, 2, 1> > const&)
()
#4 0x00000000005e5237 in hectorslam::ScanMatcher<hectorslam::OccGridMapUtilConfig<hectorslam::OccGridMapBase<LogOddsCell, GridMapLogOddsFunctions> > >::matchData(Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, hectorslam::OccGridMapUtilConfig<hectorslam::OccGridMapBase<LogOddsCell, GridMapLogOddsFunctions> >&, hectorslam::DataPointContainer<Eigen::Matrix<float, 2, 1, 0, 2, 1> > const&, Eigen::Matrix<float, 3, 3, 0, 3, 3>&, int) ()
#5 0x00000000005dfcb4 in hectorslam::MapProcContainer::matchData(Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, hectorslam::DataPointContainer<Eigen::Matrix<float---Type to continue, or q to quit---
, 2, 1, 0, 2, 1> > const&, Eigen::Matrix<float, 3, 3, 0, 3, 3>&, int) ()
#6 0x00000000005e05b5 in hectorslam::MapRepMultiMap::matchData(Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, hectorslam::DataPointContainer<Eigen::Matrix<float, 2, 1, 0, 2, 1> > const&, Eigen::Matrix<float, 3, 3, 0, 3, 3>&) ()
#7 0x00000000005e0942 in hectorslam::HectorSlamProcessor::update(hectorslam::DataPointContainer<Eigen::Matrix<float, 2, 1, 0, 2, 1> > const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, bool) ()
#8 0x00000000005d6ba2 in HectorMappingRos::scanCallback(sensor_msgs::LaserScan_std::allocator const&) ()
#9 0x000000000063622a in boost::mfi::mf1<void, HectorMappingRos, sensor_msgs::LaserScan_std::allocator const&>::operator()(HectorMappingRos, sensor_msgs::LaserScan_std::allocator const&) const ()
#10 0x000000000062d0b1 in void boost::_bi::list2<boost::bi::value<HectorMappingRos>, boost::arg<1> >::operator()<boost::mfi::mf1<void, HectorMappingRos, sensor_msgs::LaserScan<std::allocator > const&>, boost::_bi::list1<sensor_msgs::LaserScan_std::allocator const&> >(boost::_bi::type, boost::_mfi::mf1<void, HectorMappingRos, sensor_msgs::LaserScan_std::allocator const&>&, boost::_bi::list1<sensor_msgs::LaserScan_std::allocator const&>&, int) ()
#11 0x0000000000624f70 in void boost::_bi::bind_t<void, boost::_mfi::mf1<void, HectorMappingRos, sensor_msgs::LaserScan_std::allocator const&>, boost::bi::list2boost::bi::value<HectorMappingRos*, boost::arg<1> > >::operator()<sensor_msgs::LaserScan_std::allocator >(sensor_msgs::LaserScan<std::all---Type to continue, or q to quit---
ocator > const&) ()
#12 0x000000000061ac81 in boost::detail::function::void_function_obj_invoker1<boost::bi::bind_t<void, boost::mfi::mf1<void, HectorMappingRos, sensor_msgs::LaserScan<std::allocator > const&>, boost::bi::list2boost::bi::value<HectorMappingRos*, boost::arg<1> > >, void, sensor_msgs::LaserScan_std::allocator const&>::invoke(boost::detail::function::function_buffer&, sensor_msgs::LaserScan_std::allocator const&) ()
#13 0x000000000066c8b7 in boost::function1<void, sensor_msgs::LaserScan
<std::allocator > const&>::operator()(sensor_msgs::LaserScan_std::allocator const&) const ()
#14 0x0000000000669943 in ros::SubscriptionCallbackHelperT<sensor_msgs::LaserScan
<std::allocator > const&, void>::call(ros::SubscriptionCallbackHelperCallParams&) ()
#15 0x00007ffff75449c5 in ros::SubscriptionQueue::call() ()
from /opt/ros/indigo/lib/libroscpp.so
#16 0x00007ffff7502777 in ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS
) () from /opt/ros/indigo/lib/libroscpp.so
#17 0x00007ffff7503583 in ros::CallbackQueue::callAvailable(ros::WallDuration)
() from /opt/ros/indigo/lib/libroscpp.so
#18 0x00007ffff75474e5 in ros::SingleThreadedSpinner::spin(ros::CallbackQueue)
() from /opt/ros/indigo/lib/libroscpp.so
#19 0x00007ffff752faeb in ros::spin() () from /opt/ros/indigo/lib/libroscpp.so
#20 0x000000000067023f in main ()

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

No branches or pull requests

2 participants