ros-teleop / twist_mux

Twist multiplexer
Apache License 2.0
56 stars 83 forks source link

twist_mux dies on ARM board when compiler optimisation enabled #13

Open Timple opened 6 years ago

Timple commented 6 years ago

We use twist_mux on the lime2 ARM boards. The ROS provided binaries ros-kinetic-twist-mux do not work. Therefor we manually compile twist_mux from source.

Today I discoved that when I enabled RelWithDebInfo optimisation the node segfaults as well.

Working: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-O3

Not working: -DCMAKE_BUILD_TYPE=RelWithDebInfo

Full output of test:


$ catkin config --cmake-args -DCMAKE_BUILD_TYPE=Debug

$ catkin build --this
---------------------------------------------------------------------
Profile:                     performance
Extending:          [cached] /opt/ros/kinetic
Workspace:                   /home/noblean/ros/kinetic/system
---------------------------------------------------------------------
Source Space:       [exists] /home/noblean/ros/kinetic/system/src
Log Space:          [exists] /home/noblean/ros/kinetic/system/logs
Build Space:        [exists] /home/noblean/ros/kinetic/system/build
Devel Space:        [exists] /home/noblean/ros/kinetic/system/devel
Install Space:      [unused] /home/noblean/ros/kinetic/system/install
DESTDIR:            [unused] None
---------------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
---------------------------------------------------------------------
Additional CMake Args:       -DCMAKE_BUILD_TYPE=Debug
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
---------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
---------------------------------------------------------------------
Workspace configuration appears valid.

NOTE: Forcing CMake to run for each package.
---------------------------------------------------------------------
[build] Found '17' packages in 0.0 seconds.                                                                                                                                 
[build] Package table is up to date.                                                                                                                                        
Starting  >>> twist_mux                                                                                                                                                     
Finished  <<< twist_mux                [ 2 minutes and 22.9 seconds ]                                                                                                       
[build] Summary: All 1 packages succeeded!                                                                                                                                  
[build]   Ignored:   16 packages were skipped or are blacklisted.                                                                                                           
[build]   Warnings:  None.                                                                                                                                                  
[build]   Abandoned: None.                                                                                                                                                  
[build]   Failed:    None.                                                                                                                                                  
[build] Runtime: 2 minutes and 23.9 seconds total.                                                                                                                          

$ rosrun twist_mux twist_mux
[FATAL] [1527595846.514193176]: Error parsing params: could not load parameter 'topics'. (namespace: /twist_mux)
[FATAL] [1527595846.527107760]: Error parsing params: could not load parameter 'locks'. (namespace: /twist_mux)
^C

$ catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release

$ catkin build --this
---------------------------------------------------------------------
Profile:                     performance
Extending:          [cached] /opt/ros/kinetic
Workspace:                   /home/noblean/ros/kinetic/system
---------------------------------------------------------------------
Source Space:       [exists] /home/noblean/ros/kinetic/system/src
Log Space:          [exists] /home/noblean/ros/kinetic/system/logs
Build Space:        [exists] /home/noblean/ros/kinetic/system/build
Devel Space:        [exists] /home/noblean/ros/kinetic/system/devel
Install Space:      [unused] /home/noblean/ros/kinetic/system/install
DESTDIR:            [unused] None
---------------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
---------------------------------------------------------------------
Additional CMake Args:       -DCMAKE_BUILD_TYPE=Release
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
---------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
---------------------------------------------------------------------
Workspace configuration appears valid.

NOTE: Forcing CMake to run for each package.
---------------------------------------------------------------------
[build] Found '17' packages in 0.0 seconds.                                                                                                                                 
[build] Package table is up to date.                                                                                                                                        
Starting  >>> twist_mux                                                                                                                                                     
Finished  <<< twist_mux                [ 2 minutes and 11.5 seconds ]                                                                                                       
[build] Summary: All 1 packages succeeded!                                                                                                                                  
[build]   Ignored:   16 packages were skipped or are blacklisted.                                                                                                           
[build]   Warnings:  None.                                                                                                                                                  
[build]   Abandoned: None.                                                                                                                                                  
[build]   Failed:    None.                                                                                                                                                  
[build] Runtime: 2 minutes and 12.4 seconds total.                                                                                                                          

$ rosrun twist_mux twist_mux
[FATAL] [1527596036.439305912]: Error parsing params: could not load parameter 'topics'. (namespace: /twist_mux)
[FATAL] [1527596036.453513454]: Error parsing params: could not load parameter 'locks'. (namespace: /twist_mux)
^C

$ catkin config --cmake-args -DCMAKE_CXX_FLAGS=-O3

$ catkin build --this
---------------------------------------------------------------------
Profile:                     performance
Extending:          [cached] /opt/ros/kinetic
Workspace:                   /home/noblean/ros/kinetic/system
---------------------------------------------------------------------
Source Space:       [exists] /home/noblean/ros/kinetic/system/src
Log Space:          [exists] /home/noblean/ros/kinetic/system/logs
Build Space:        [exists] /home/noblean/ros/kinetic/system/build
Devel Space:        [exists] /home/noblean/ros/kinetic/system/devel
Install Space:      [unused] /home/noblean/ros/kinetic/system/install
DESTDIR:            [unused] None
---------------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
---------------------------------------------------------------------
Additional CMake Args:       -DCMAKE_CXX_FLAGS=-O3
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
---------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
---------------------------------------------------------------------
Workspace configuration appears valid.

NOTE: Forcing CMake to run for each package.
---------------------------------------------------------------------
[build] Found '17' packages in 0.0 seconds.                                                                                                                                 
[build] Package table is up to date.                                                                                                                                        
Starting  >>> twist_mux                                                                                                                                                     
Finished  <<< twist_mux                [ 2 minutes and 10.2 seconds ]                                                                                                       
[build] Summary: All 1 packages succeeded!                                                                                                                                  
[build]   Ignored:   16 packages were skipped or are blacklisted.                                                                                                           
[build]   Warnings:  None.                                                                                                                                                  
[build]   Abandoned: None.                                                                                                                                                  
[build]   Failed:    None.                                                                                                                                                  
[build] Runtime: 2 minutes and 11.1 seconds total.                                                                                                                          

$ rosrun twist_mux twist_mux
[FATAL] [1527596233.345567307]: Error parsing params: could not load parameter 'topics'. (namespace: /twist_mux)
[FATAL] [1527596233.361381641]: Error parsing params: could not load parameter 'locks'. (namespace: /twist_mux)
^C

$ catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo

$ catkin build --this
---------------------------------------------------------------------
Profile:                     performance
Extending:          [cached] /opt/ros/kinetic
Workspace:                   /home/noblean/ros/kinetic/system
---------------------------------------------------------------------
Source Space:       [exists] /home/noblean/ros/kinetic/system/src
Log Space:          [exists] /home/noblean/ros/kinetic/system/logs
Build Space:        [exists] /home/noblean/ros/kinetic/system/build
Devel Space:        [exists] /home/noblean/ros/kinetic/system/devel
Install Space:      [unused] /home/noblean/ros/kinetic/system/install
DESTDIR:            [unused] None
---------------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
---------------------------------------------------------------------
Additional CMake Args:       -DCMAKE_BUILD_TYPE=RelWithDebInfo
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
---------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
---------------------------------------------------------------------
Workspace configuration appears valid.

NOTE: Forcing CMake to run for each package.
---------------------------------------------------------------------
[build] Found '17' packages in 0.0 seconds.                                                                                                                                 
[build] Package table is up to date.                                                                                                                                        
Starting  >>> twist_mux                                                                                                                                                     
Finished  <<< twist_mux                [ 3 minutes and 6.5 seconds ]                                                                                                        
[build] Summary: All 1 packages succeeded!                                                                                                                                  
[build]   Ignored:   16 packages were skipped or are blacklisted.                                                                                                           
[build]   Warnings:  None.                                                                                                                                                  
[build]   Abandoned: None.                                                                                                                                                  
[build]   Failed:    None.                                                                                                                                                  
[build] Runtime: 3 minutes and 7.4 seconds total.                                                                                                                           

$ rosrun twist_mux twist_mux
Segmentation fault
MCFurry commented 6 years ago

And since shortly compiling from source also results in segfaults with either compiler flags...

I just made a fresh armbian image for the lime2 board. The resulting binary for twist_mux segfaults.

Interestingly if I copy the physical binary from another board, it does run on my fresh image. Hence, it seems that compilation from source broke and it may be related to some linux updates? (Since the twist_mux source hasn't changed lately?)