Closed johaq closed 7 years ago
I think I fixed this issue. In client_goal_handle_imp.h we have:
template<class ActionSpec>
void ClientGoalHandle<ActionSpec>::reset()
{
if (active_)
{
DestructionGuard::ScopedProtector protector(*guard_);
if (!protector.isProtected())
{
ROS_ERROR_NAMED("actionlib", "This action client associated with the goal handle has already been destructed. Ignoring this reset() call");
return;
}
boost::recursive_mutex::scoped_lock lock(gm_->list_mutex_);
list_handle_.reset();
active_ = false;
gm_ = NULL;
}
}
template<class ActionSpec>
CommState ClientGoalHandle<ActionSpec>::getCommState() const
{
if (!active_)
{
ROS_ERROR_NAMED("actionlib", "Trying to getCommState on an inactive ClientGoalHandle. You are incorrectly using a ClientGoalHandle");
return CommState(CommState::DONE);
}
DestructionGuard::ScopedProtector protector(*guard_);
if (!protector.isProtected())
{
ROS_ERROR_NAMED("actionlib", "This action client associated with the goal handle has already been destructed. Ignoring this getCommState() call");
return CommState(CommState::DONE);
}
assert(gm_);
boost::recursive_mutex::scoped_lock lock(gm_->list_mutex_);
return list_handle_.getElem()->getCommState();
}
As you can see active is set to false in the reset method after acquiring the scoped_lock. But it is checked in getCommState before acquiring it. This lead to an error when one thread called a reset while another asked for the commState. Pull Request: #77
fixed in #77
I am getting a segmentation fault when getState() in the simple action client is called. Extract from the gdb backtrace:
The code in NavigationServer.cpp: