Catkin_make seg faults while building messages on ARM

asked 2016-04-05 09:25:51 -0600

Cerin gravatar image

I have a package containing some custom message and service definitions, and when I run catkin_make --pkg mypackage_msgs it will throw a segmentation fault error at a seemingly arbitrary point in the build process.

The output looks something like:

[  0%] Built target std_msgs_generate_messages_py
[  0%] [  0%] Built target _mypackage_msgs_generate_messages_check_deps_PanPower
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_PacketRead
Built target _mypackage_msgs_generate_messages_check_deps_PacketWrite
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_AccelGyro
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_Edge
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_MotorSpeed
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_LedAuto
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_PanFullRevCount
[  0%] [  0%] Built target _mypackage_msgs_generate_messages_check_deps_RemainingTime
Built target _mypackage_msgs_generate_messages_check_deps_ExternalPower
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_PanSpeed
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_PanAngle
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_PanCentermark
[  0%] [  0%] Built target _mypackage_msgs_generate_messages_check_deps_Ultrasonic
Built target _mypackage_msgs_generate_messages_check_deps_Sleep
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_BatteryChargeRatio
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_SonarPower
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_RechargePowerdown
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_Shutdown
Segmentation fault
../catkin_generated/env_cached.sh: 15: .: Can't open /usr/local/myrobot/src/ros/build/mypackage_msgs/setup_cached.sh
make[2]: *** [mypackage_msgs/CMakeFiles/_mypackage_msgs_generate_messages_check_deps_BatteryVoltage] Error 2
make[1]: *** [mypackage_msgs/CMakeFiles/_mypackage_msgs_generate_messages_check_deps_BatteryVoltage.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_Pong
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_ArduinoTemperature
[  0%] Built target _mypackage_msgs_generate_messages_check_deps_BatteryTemperature
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

but each run changes a little, failing at a different point. I can't find anything wrong with my files.

I'm building on a Raspberry Pi, and the build runs fine when I run it on an x86_64 machine, so I suspect there's some bug in the ARM version of ROS. I've tried doing a catkin_make clean but that doesn't effect the outcome.

How do I fix this error?

edit retag flag offensive close merge delete

Comments

1

I would first check that you're not running out of memory. The Pi has rather limited resources, and compiling ROS (especially msgs) can use quite some memory. I've seen similar errors on systems without swap, fi.

gvdhoorn gravatar image gvdhoorn  ( 2016-04-05 10:11:05 -0600 )edit

The error Can't open /usr/local/myrobot/src/ros/build/mypackage_msgs/setup_cached.sh looks unusual as well.

ahendrix gravatar image ahendrix  ( 2016-04-05 12:37:48 -0600 )edit

@gvdhoorn, I suspect that was the problem, but oddly enough, I just rebooted and re-ran catkin_make with htop running, but I never saw memory usage rise above 10%...and it built without error. I have 1.7GB of swap, which should be plenty, so I'm not sure why low memory would have caused a seg fault.

Cerin gravatar image Cerin  ( 2016-04-05 21:46:27 -0600 )edit