roboticslab-uc3m / yarp-devices

A place for YARP devices
https://robots.uc3m.es/yarp-devices/
9 stars 7 forks source link

Error while opening /usr/local/lib/yarp/yarp_controlboardwrapper2.so #255

Closed rsantos88 closed 3 years ago

rsantos88 commented 3 years ago

I want to comment on an error that has occurred quite often for a long time. Sometimes, when I go to start launchCanBus, the following message is displayed in the process of its execution:

[info] TechnosoftIpos.cpp:337 interpretModesOfOperation(): Profile Position Mode. canId: 20.
[info] TechnosoftIpos.cpp:58 reportBitToggle(): [status] Bit reset: Target reached. (canId: 20)
[info] TechnosoftIpos.cpp:58 reportBitToggle(): [MSR] Bit reset: Target command reached. (canId: 20)
[INFO] |yarp.dev.PolyDriver| Created device <CanBusControlboard>. See C++ class roboticslab::CanBusControlboard for documentation.
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /usr/local/lib/yarp/yarp_controlboardwrapper2.so:
  /usr/local/lib/yarp/yarp_controlboardwrapper2.so: undefined symbol: _ZN4yarp2os3Log16forward_callbackE
[WARNING] |yarp.os.YarpPluginSettings| Cannot load plugin from shared library (yarp_controlboardwrapper2)
[WARNING] |yarp.os.YarpPluginSettings| (yarp_controlboardwrapper2: cannot open shared object file: No such file or directory)
[ERROR] |yarp.dev.PolyDriver| Could not find device <controlboardwrapper2>
[error] LaunchCanBus.cpp:117 configure(): Wrapper device leftArmPort configuration failure.
[INFO] |yarp.os.RFModule| RFModule failed to open.

Normally, when I want to quickly fix this error, I delete the /usr/local/lib/yarp/yarp_controlboardwrapper2.so file and reinstall yarp (sudo make install) to redo the library installation. It may not be the best solution, as it is temporarily fixed but the error reappears again another day. What could it be due to?

PeterBowman commented 3 years ago

It baffles me that the fix doesn't persist after a reinstalation. I might have seen this before, perhaps in an upstream issue/patch, in which case it might have been fixed in the meantime. I have updated YARP, so let's see if this happens again:

BTW the description suggests YARP 3.4.x because of the new logging system.

rsantos88 commented 3 years ago

OK thanks. I'll watch it :eyes:

rsantos88 commented 3 years ago

Today, starting the manipulation launch, I've found again the same error that I solved by removing the file and reinstalling it. I leave here the sample of the terminal in case it could give some interesting clue. yarp_controlboardwrapper2 error.zip

jgvictores commented 3 years ago

Could be wrong, but really looks like an issue due to multiple installations of YARP.

I'd really completely wipe everything out, especially do a sudo rm -rf /usr/local/lib/yarp /usr/local/share/yarp but also lots of sudo updatedb; locate yarp; locate YARP to really purge everything (including symbolic links). Finally recompile+reinstall YARP and recompile+reinstall yarp-devices.

PeterBowman commented 3 years ago

There are a few more error lines in that output:

[INFO] |yarp.dev.PolyDriver| Created device <CanBusPeak>. See C++ class roboticslab::CanBusPeak for documentation.
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /usr/local/lib/yarp/yarp_portmonitor.so:
  /usr/local/lib/yarp/yarp_portmonitor.so: undefined symbol: _ZN4yarp2os3Log16forward_callbackE
[INFO] |yarp.os.Port| Port /teo/can/rightArm/dump:o active at tcp://2.2.2.51:10003/
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /usr/local/lib/yarp/yarp_portmonitor.so:
  /usr/local/lib/yarp/yarp_portmonitor.so: undefined symbol: _ZN4yarp2os3Log16forward_callbackE
[INFO] |yarp.os.Port| Port /teo/can/rightArm/send:i active at tcp://2.2.2.51:10004/
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /usr/local/lib/yarp/yarp_portmonitor.so:
  /usr/local/lib/yarp/yarp_portmonitor.so: undefined symbol: _ZN4yarp2os3Log16forward_callbackE
[INFO] |yarp.os.Port| Port /teo/can/rightArm/sdo:s active at tcp://2.2.2.51:10005/
[ERROR] |yarp.os.YarpPluginSettings| Error while opening /usr/local/lib/yarp/yarp_portmonitor.so:
  /usr/local/lib/yarp/yarp_portmonitor.so: undefined symbol: _ZN4yarp2os3Log16forward_callbackE
[INFO] |yarp.os.Port| Port /teo/can/rightArm/load:o active at tcp://2.2.2.51:10006/

Suggestions:

PeterBowman commented 3 years ago

I have a suspicion YARP 3.4 was once installed on that PC (manipulation), then we rolled back to YARP 3.3.

So I think the /usr/local/lib/yarp/yarp_controlboardwrapper2.so is trying to link against /usr/local/lib/libYARP_os.so.3.3.3, but there is a /usr/local/lib/libYARP_os.so.3.4.x symlinked by /usr/local/lib/libYARP_os.so that shadows old symbols. On a second thought, please try this:

rsantos88 commented 3 years ago
PeterBowman commented 3 years ago

Yeah, thank you, that's it: yarp_controlboardwrapper2.so links against libYARP_os.so.3 which is a symlink to libYARP_os.so.3.4.0, but you must have everything else (i.e. yarp-devices+launchCanBus) compiled against libYARP_os.so.3.3.3, so the linker goes crazy.

Please rm /usr/local/lib/libYARP_* (do ls first and check just in case). Make sure YARP is on the yarp-3.3 branch, compile and reinstall, then proceed likewise with yarp-devices.

rsantos88 commented 3 years ago

Done! Thanks for your help