ros-industrial / ros_canopen

CANopen driver framework for ROS (http://wiki.ros.org/ros_canopen)
GNU Lesser General Public License v3.0
332 stars 270 forks source link

Segmentation fault when using ThreadedSocketCANInterface #406

Closed ozzdemir closed 3 years ago

ozzdemir commented 3 years ago

I was using ThreadedSocketCANInterface for interfacing with the CAN network. But with latest update(0.8.4), I am having a segmentation fault. Following is the gdb output. I guess it is related with the change implemented report-only and fatal errors for SocketCANInterface. My guess is that it is only implemented for regular socketcan_interface and the situation broke the threaded one.

Thread 1 "node" received signal SIGSEGV, Segmentation fault.
can::Settings::get_optional<bool> (this=0x0, n="fatal_error_mask/CAN_ERR_LOSTARB", 
    def=@0x7fffffffc64f: false)
    at /opt/ros/melodic/include/socketcan_interface/settings.h:16
16                if(!getRepr(n, repr)){

OS: Ubuntu 18.04 Distro: Melodic

stribor14 commented 3 years ago

+1 same thing happens to us

mathias-luedtke commented 3 years ago

Did you try to clean and rebuild your workspace?

ozzdemir commented 3 years ago

Just tried cleaning the workspace, and the same result.

mathias-luedtke commented 3 years ago

Just tried cleaning the workspace, and the same result.

Can you share the code with us? At least a snippet?

mathias-luedtke commented 3 years ago

I think I found the issue, please try https://github.com/ros-industrial/ros_canopen/pull/407

If you cannot wait for the release, pass the settings explicitly.

ozzdemir commented 3 years ago

With #407, the problem is solved.

mathias-luedtke commented 3 years ago

Thanks for testing! I will release it ASAP.

mathias-luedtke commented 3 years ago

https://github.com/ros/rosdistro/pull/26653 https://github.com/ros/rosdistro/pull/26654