segfault in spinOnce, what is wrong?
I have nodes crashing short after launch, the console output is for example:
[JoggingNode-21] process has died [pid 29521, exit code -11
The problem only appears when I start the full system with 30+ nodes, not if I launch the single node.
The problem appears for different nodes for each launch.
The problem seems to be highly timing dependent and disappears if I launch the node with gdb or relaunch the crashed node while leaving the other nodes running.
I can printf debug the problem down to calling spinOnce.
Questions:
- What is exit code -11 ?
- Any way I can see in a log which callbacks ROS has been calling
- Is combining spin and spinOnce a problem? I use it through out several nodes like shown below:
ROS node pseudo code:
void someCallback() {
while (!ready) {
spin_once();
}
...
}
void someCallback2() {
ready = true;
}
int main() {
...
setupCallbacks();
spin();
}
[EDIT]
Edited title. Also managed to get a core dump, here is the stack trace:
(gdb) bt
#0 0x00007fd568a88fac in std::deque<ros::CallbackQueue::CallbackInfo, std::allocator<ros::CallbackQueue::CallbackInfo> >::_M_erase(std::_Deque_iterator<ros::CallbackQueue::CallbackInfo, ros::CallbackQueue::CallbackInfo&, ros::CallbackQueue::CallbackInfo*>) () from /opt/ros/kinetic/lib/libroscpp.so
#1 0x00007fd568a85cc1 in ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*) ()
from /opt/ros/kinetic/lib/libroscpp.so
#2 0x00007fd568a870f3 in ros::CallbackQueue::callAvailable(ros::WallDuration) ()
from /opt/ros/kinetic/lib/libroscpp.so
#3 0x00007fd568ac4795 in ros::spinOnce() () from /opt/ros/kinetic/lib/libroscpp.so
Comments to see whether others answer:
-11
isSEGFAULT
Oh I would love some advice on the spin design. I feel this is appropriate for a new question
Thanks for trying to get that GDB backtrace, but without debug symbols it's not going to be very informative.
Well, my intention was just to verify that the crash is in the spinOnce code itself, not in my callback code.