ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Hi Clefairy,

Segmentation fault would occur only if there is an access to invalid memory. There could be several reasons for this to happen based on what you are doing in your code.

One simple scenario would be the case of a publisher and subscriber. If you are having both of these in your code, you are probably trying to access data from the subscriber which is not yet made ready by the publisher.

If you are using data structures like arrays there is a strong possibility of accessing data before making that ready.

Lastly, if you are running multiple spins you may have to set the same data rate throughout to avoid segmentation faults.

If you need further help we may be able to do that after seeing your code or the trace from gdb as pointed out by jbohren.

Regards,