Skip to content

yarprobotinterface segmentation fault when closing a PolyDriver using remotecontrolboardremapper #3354

Description

@SuperDiodo

Describe the bug

When the module exits (e.g., after pressing Ctrl+C) or when PolyDriver::close() is called, the remote yarpmotorinterface process crashes with a segmentation fault.

To Reproduce

  1. Instantiate and open a PolyDriver configured to use the remotecontrolboardremapper device.
  2. Configure the remoteControlBoards property to connect to one or more robot parts (e.g., head, torso, and right arm).
  3. Acquire the required control interfaces and communicate with the robot.
  4. Close the PolyDriver by calling PolyDriver::close(), or terminate the module with Ctrl+C.
  5. Observe that the remote yarpmotorinterface process crashes with a segmentation fault.

Expected behavior

Closing the module with Ctrl+C or calling PolyDriver::close() should cleanly disconnect from the robot without affecting yarpmotorinterface. Instead, yarpmotorinterface crashes and prints the following log:

[ERROR] yarprobotinterface intercepted a segmentation fault caused by a faulty plugin:
[ERROR] /lib/x86_64-linux-gnu/libc.so.6(+0x84ae9) [0x7f31b4605ae9]
Trace requested at /usr/local/src/robot/robotology-superbuild/src/YARP/src/yarprobotinterface/Module.cpp:77 by code called from:
/usr/local/src/robot/robotology-superbuild/build/install/lib/libYARP_os.so.3(_Z16yarp_print_traceP8_IO_FILEPKcj+0x27) [0x7f31b4b0fb87]
yarprobotinterface(+0x950d) [0x55599e42750d]
/lib/x86_64-linux-gnu/libc.so.6(+0x37840) [0x7f31b45b8840]
/lib/x86_64-linux-gnu/libc.so.6(+0x84ae9) [0x7f31b4605ae9]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7fc9) [0x7f31b2ac4fc9]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f31b467a4cf]
Segmentation fault

Configuration (please complete the following information):

  • OS: Ubuntu 24.04 LTS
  • YARP version (client): 3.12 (module running on an external PC)
  • YARP version (server): 3.09 (yarpmotorinterface running on the iCub head PC)
  • Compiler: GCC 13.3.0

Additional context

The module controls joints belonging to different iCub parts (e.g., head, torso, and right arm) as a single logical unit through remotecontrolboardremapper.

The implementation is based on the following example:
https://github.com/traversaro/yarp-wholebody-motorcontrol-example/blob/master/yarpWholeBodyMotorControlExample.cpp

The module loads a joint trajectory from a CSV file and executes it.

The same implementation works correctly in Gazebo, where I can repeatedly start and stop the module without any issues.

The problem only occurs on the real iCub. After the module exits, the yarpmotorinterface process crashes, forcing me to perform an emergency stop on the robot and manually restart yarpmotorinterface before I can run the module again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions