robotology / icub-tech-support

Virtual repository that provides support requests for individual robots
GNU General Public License v2.0
20 stars 2 forks source link

ergoCub 1.3 S/N:002 – When closing the yarprobotinterface, it always segfaults #1861

Open S-Dafarra opened 4 months ago

S-Dafarra commented 4 months ago

Robot Name 🤖

ergoCub 1.2 S/N:002

Request/Failure description

Whenever we close the yarprobotinterface, it does not exit gracefully, but it starts throwing a lot of errors and then it crashes. The robot anyhow goes to parking as expected.

Detailed context

Here an example of output

[INFO] Closing device right_leg-FT_remapper
[INFO] Closing device left_leg-FT_remapper
[INFO] Closing device right_leg-eb6-j0_3-strain
[INFO] Closing device left_leg-eb8-j0_3-strain
[INFO] Closing device right_leg-eb7-j4_5-strain
[INFO] Closing device left_leg-eb9-j4_5-strain
[INFO] Closing device right_arm-eb1-j0_1-strain
[INFO] Closing device left_arm-eb2-j0_1-strain
[INFO] Closing device right_leg-eb7-j4_5-mc
[INFO] Closing device right_leg-eb6-j0_3-mc
[ERROR] theNVmanager::Impl::transceiverZ() cannot obtain from TheEthManager a EthResource * for IP = 10.0.1.6
[ERROR] yarprobotinterface intercepted a segmentation fault caused by a faulty plugin:
[ERROR] /usr/local/src/robot/robotology-superbuild/build/install/lib/iCub/embObjPOS.so(_ZN3eth15HostTransceiver11addSetROP__EjPKvjb+0x23) [0x7f92900a2513]
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+0x3b) [0x7f929b69311b]
yarprobotinterface(+0x9c94) [0x55d0c5284c94]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f929b1b9520]
/usr/local/src/robot/robotology-superbuild/build/install/lib/iCub/embObjPOS.so(_ZN3eth15HostTransceiver11addSetROP__EjPKvjb+0x23) [0x7f92900a2513]
/usr/local/src/robot/robotology-superbuild/build/install/lib/iCub/embObjPOS.so(_ZN3eth12theNVmanager4Impl3setEPNS_15HostTransceiverEjPKv+0x41) [0x7f929008abb1]
/usr/local/src/robot/robotology-superbuild/build/install/lib/iCub/embObjPOS.so(_ZN3eth12theNVmanager4Impl7commandEPNS_15HostTransceiverEjPKvjPvd+0x41) [0x7f929008e1a1]
/usr/local/src/robot/robotology-superbuild/build/install/lib/iCub/embObjPOS.so(_ZN3eth11EthResource14serviceCommandE21eOmn_serv_operation_t20eOmn_serv_category_tPK21eOmn_serv_parameter_tdi+0x12f) [0x7f929006eb4f]
/usr/local/src/robot/robotology-superbuild/build/install/lib/iCub/embObjPOS.so(_ZN3eth11EthResource11serviceStopE20eOmn_serv_category_td+0x23) [0x7f929006f463]
/usr/local/src/robot/robotology-superbuild/build/install/lib/iCub/embObjPOS.so(_ZN3eth13TheEthManager16releaseResource2EPNS_19AbstractEthResourceEPNS_12IethResourceE+0x60) [0x7f92900685d0]
/usr/local/src/robot/robotology-superbuild/build/install/lib/iCub/embObjMotionControl.so(_ZN4yarp3dev19embObjMotionControl7cleanupEv+0x27) [0x7f9280661a67]
/usr/local/src/robot/robotology-superbuild/build/install/lib/iCub/embObjMotionControl.so(_ZN4yarp3dev19embObjMotionControl5closeEv+0x13f) [0x7f928067f17f]
/usr/local/src/robot/robotology-superbuild/build/install/lib/libYARP_dev.so.3(_ZN4yarp3dev10PolyDriver5closeEv+0x68) [0x7f929b11db88]
/usr/local/src/robot/robotology-superbuild/build/install/lib/libYARP_robotinterface.so.3(_ZN4yarp14robotinterface6Device5closeEv+0x48) [0x7f929b8137c8]
/usr/local/src/robot/robotology-superbuild/build/install/lib/libYARP_robotinterface.so.3(_ZN4yarp14robotinterface5Robot7Private12closeDevicesEv+0xe2) [0x7f929b81bf02]
/usr/local/src/robot/robotology-superbuild/build/install/lib/libYARP_robotinterface.so.3(_ZN4yarp14robotinterface5Robot10enterPhaseENS0_11ActionPhaseE+0x6b3) [0x7f929b81ef73]
yarprobotinterface(+0xb0ee) [0x55d0c52860ee]
/usr/local/src/robot/robotology-superbuild/build/install/lib/libYARP_os.so.3(_ZN4yarp2os8RFModule9runModuleEv+0x2b0) [0x7f929b6f2ef0]
yarprobotinterface(+0x8bcf) [0x55d0c5283bcf]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f929b1a0d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f929b1a0e40]
yarprobotinterface(+0x8c95) [0x55d0c5283c95]
Segmentation fault (core dumped)

Additional context

No response

How does it affect you?

No response

pattacini commented 4 months ago

cc @marcoaccame

marcoaccame commented 4 months ago

The important info is in here

image

What I see happening is that a UDP frame is received from board 10.0.1.6 and the receiver thread managed by object theETHManager cannot get the associated EthResource for its handling (parsing etc.).

I also see that just before that a lot of devices have been destroyed.

I would look at what has changed in the destructors of the devices w/ respect to destruction of the associated EthResource (whihc must be destroyed only when no associated device is remaining).

Or maybe it is a mutex race that depends on the 1 kHz?