Search Unity

Built executable won't run on Linux - libdl.so not found

Discussion in 'Linux' started by spyderrr, Dec 2, 2019.

  1. spyderrr

    spyderrr

    Joined:
    Apr 1, 2018
    Posts:
    4
    I have a problem where a successfully built Unity game won't run on Ubuntu 18.04 LTS.

    The problem seems to be connected to the linker, which can't be found. The app crashes after the splash screen. An excerpt from the Player.log file:
    I do have libdl.so installed. Here is the output of ldd on the game executable:
    I also checked the symbolic link to libdl.so.2, which is valid and points to libdl-2.27.so.

    I am using UnityRos2, which adds several client libraries for ROS2 as plugins. Here is the repo, including a sample Unity project: https://github.com/DynoRobotics/UnityRos2

    I have no problems running the application in the editor. There are also no build errors.

    I have tested this with Unity 2019.2.14f1 running on Ubuntu 18.04 LTS.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    I don't think that error actually is related to your game not running. Can you paste the full editor log?
     
  3. spyderrr

    spyderrr

    Joined:
    Apr 1, 2018
    Posts:
    4
    Sorry for the delayed response. Here are the full contents of the Editor log:

     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Oops, I'm so sorry - I actually meant the player log (from the player that doesn't run).
     
  5. spyderrr

    spyderrr

    Joined:
    Apr 1, 2018
    Posts:
    4
    Here's the Player log:

     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    So the game crashes when C# code calls into function called "rcl_node_init". Do you know what this function is?
     
  7. spyderrr

    spyderrr

    Joined:
    Apr 1, 2018
    Posts:
    4
    This is part of ROS2's library. It initializes a ROS2 node. Here is a LINK to ROS2's documentation.
    What could be the reason that the function doesn't fail when run in the editor? What do you think of the linker error?
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    There's no linker error. That error is from Unity plugin code trying to load the dynamic library as "Unity plugin" and failing, which is harmless. It has nothing to do with this crash.

    I don't know why that library crashes. Perhaps you should ask its authors? I assume you don't have its source code to debug it?
     
  9. sam_dyno

    sam_dyno

    Joined:
    Dec 7, 2019
    Posts:
    6
    Hi,

    I'm the main author for the https://github.com/DynoRobotics/UnityRos2 project and a large part of the C# ROS2 integration it uses.

    We have spent quite a lot of time trying to get the linking for ROS2:s c-libraries to work through Unity's plugin loader. Unfortunately, we have not managed to get that to work yet. My current theory is that it has something to do with runtime linking in the ROS2 libraries that use the "POCO C++ Libraries".

    The Unity-project currently uses a workaround with custom python-scripts that appends the relevant plugin folder to LD_LIBRARY_PATH to before starting the Editor or Player. Instructions for starting the player using this special script was not in our documentation, so that would be pretty hard to figure out for new users...

    I think the ROS2 integration could be a very good addition to your Unity Simulation initiative.
    Sending data through DDS/ROS2 is a lot more performant than the WebSocket approach that LGSVL is currently using. This is especially relevant for sending point clouds from simulated 3D-sensors to code running outside Unity.
    Some open-source software projects for self-driving cars like Autoware (https://www.autoware.auto/) are also in the process of porting to ROS2.

    Any help with fixing the linking so that we don't need to use the LD_LIBRARY_PATH hack would be greatly appreciated!

    All source code related to this project (including ROS2) is open-source and available online.
     
    spyderrr likes this.
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Could you explain what's going on with LD_LIBRARY_PATH? Why do you need to use it and what happens if you don't?

    Do you think that's the crash that spyderrr is seeing?
     
  11. sam_dyno

    sam_dyno

    Joined:
    Dec 7, 2019
    Posts:
    6
    I can certainly try!

    The Player log from spyderrr seems to indicate that Unity is preloading the .so libraries, which I have not been able to get to work. I'm pretty sure his crash is related to this.

    Some general info about the implementation first:

    The .so files that are causing the issue on Linux can be seen here: https://github.com/DynoRobotics/UnityRos2/tree/dashing/Assets/Plugins/Linux/x86_64

    Since I wanted the same C# code to support both Linux, Windows 10 and potentially other platforms (like UWP for hololens, macOSX and Android), I could not use DllImport directly.

    I ended up using a utility-script written by Esteve Fernandez for an earlier implementation of a ROS2 C# integration to enable this type of cross-platform support:
    https://github.com/samiamlabs/ros2_dotnet/blob/master/rcldotnet_common/DllLoadUtils.cs
    Here is an example of how it is used:
    https://github.com/samiamlabs/ros2_dotnet/blob/master/rcldotnet/NativeMethods.cs
    It loads the platform-specific linker using DllImport. On linux this is dlopen (libdl.so).
    The rest of the libraries are then loaded directly using dlopen.

    I have unit tests that cover all of the calls to unmanaged code. They all pass outside Unity on both Windows 10 and Ubuntu 18.04. https://github.com/samiamlabs/ros2_dotnet/blob/master/rcldotnet_tests/NativeMetodsTest.cs

    If the libraries are not preloaded, dlopen looks for them in LD_LIBRARY_PATH on Linux (or PATH for the Windows 10 linker).

    The problems with using this in Unity:

    If the "load on startup" option is checked in the Unity Editor Inspector for the .so files, the Editor crashes immediately on startup.

    I have not been able to get much good information about this crash.
    What little I have been able to find in ~/.config/unity3d/Editor.log seems to change between versions of Unity or something.

    Right now with Unity 2019.2.8f1 Editor I'm getting:

    (Filename: ./Runtime/Misc/Plugins.cpp Line: 282)
    Plugins: Couldn't open Assets/Plugins/Linux/x86_64/libaction_msgs__rosidl_generator_c.so, error: libbuiltin_interfaces__rosidl_generator_c.so: cannot open shared object file: No such file or directory
    Repeated for a bunch of the .so files.

    If the libraries are not preloaded, the linker will not be able to find them.
    Setting the LD_LIBRARY_PATH environment variable to the Assets/Plugins/Linux/x86_64 and making it available to the Unity Editor (by not going through UnityHub) seems to fix this for the most part.

    Worth noting is that in more recent Unity Editor releases it has been necessary to preload the runtime-linked "librmw_fastrtps_cpp.so" (not using Unity preloading). If this is not done, any functions that use the ROS2 libraries, (like "rcl_node_init") will cause a crash when first called. This has not been necessary for the player in the versions of Unity I have tested.
    See: https://github.com/DynoRobotics/Uni...dc/Assets/Scripts/ROS/SharedRosContext.cs#L43
    And:
    https://github.com/samiamlabs/ros2_...79cb027/rcldotnet_common/DllLoadUtils.cs#L257

    Have seen some pretty odd stuff from gnucrash backtraces for the Player. This "string compare" error in what appears to be openssl for example:

    #0 __strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:173
    #1 0x00007ffff684ccba in getrn () from /home/sam/dyno/unity/Builds/LinuxPlayer.so
    #2 0x00007ffff684cff0 in lh_insert () from /home/sam/dyno/unity/Builds/LinuxPlayer.so
    #3 0x00007ffff6821437 in OBJ_NAME_add () from /home/sam/dyno/unity/Builds/LinuxPlayer.so
    #4 0x00007ffff1bfae5e in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
    #5 0x00007ffff42b7827 in __pthread_once_slow (once_control=0x7ffff1e53928, init_routine=0x7ffff1bfad70)
    at pthread_once.c:116
    #6 0x00007ffff18db8f9 in CRYPTO_THREAD_run_once () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
    #7 0x00007ffff1bfb07b in OPENSSL_init_ssl () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
    #8 0x00007ffff32413ce in asio::ssl::detail::eek:penssl_init_base::instance() ()
    from /home/sam/dyno/dotnet/ros2_dashing_ws/install/fastrtps/lib/libfastrtps.so.1
    #9 0x00007ffff313b654 in _GLOBAL__sub_I_TCPChannelResource.cpp ()
    from /home/sam/dyno/dotnet/ros2_dashing_ws/install/fastrtps/lib/libfastrtps.so.1
    #10 0x00007ffff7de5733 in call_init (env=0x7fffffff2868, argv=0x7fffffff2858, argc=1, l=<optimized out>)
    at dl-init.c:72
    #11 _dl_init (main_map=0x7ffff7ffe170, argc=1, argv=0x7fffffff2858, env=0x7fffffff2868) at dl-init.c:119
    #12 0x00007ffff7dd60ca in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
    #13 0x0000000000000001 in ?? ()
    #14 0x00007fffffff2c62 in ?? ()
    #15 0x0000000000000000 in ?? ()​

    Hope this made the issue a bit more clear...

    Don't know how to proceed at this point. I suspect I need help from someone who knows how the linking and plugin loading works in Unity under the hood.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    You should be able to use DllImport and have it work on all platforms. Just exclude the native library extension and you should be set.

    The crash doesn't sound related to how you're loading the plugins at all, though.. let's take a look.

    Which .so file is frame #0 part of? This almost looks like a mismatch between several different C runtimes.
     
  13. sam_dyno

    sam_dyno

    Joined:
    Dec 7, 2019
    Posts:
    6
    I think I had some issues with getting that approach to work, but don't remember exactly what the problem was.
    Maybe it could be that it only works if you build it as a netcoreapp3.0 as indicated here https://stackoverflow.com/questions...m-ubuntu-windows-with-library-that-contains-d?

    I currently build the C# code as a netcoreapp2.0. I think the dotnet-sdk-3 was not available for Linux yet when I started working on this, but I could be wrong...

    Will look into it. If you don't think this is the cause for the crash, it will probably take me a while until I get around to do all that refactoring and testing though...
     
  14. sam_dyno

    sam_dyno

    Joined:
    Dec 7, 2019
    Posts:
    6
    Based on #8 it seems to be this file: https://github.com/DynoRobotics/UnityRos2/blob/dashing/Assets/Plugins/Linux/x86_64/libfastrtps.so.1
    The source for it is here
    https://github.com/eProsima/Fast-RTPS
    All the .so files were built locally from source on the same machine that was running Unity.

    Btw, the gnucrash trace is from an earlier version of the project where I had not moved all the .so files into the Unity projects Plugin folder. I had only put the .so files that were custom for the C# ROS2 integration in the Plugin folder at that time I believe.
    For the other standard ROS2 related .so files, I sourced a setup.bash script in the terminal where I started Unity. That script appends the paths to the rest of the .so files to LD_LIBRARY_PATH (this is standard for ROS2 workspaces).
    I can make a new attempt at getting a trace for the current project setup if you want me to.

    Could libfastrtps.so.1 somehow be dynamically linking to a different C runtime than it was built for? Or what do you mean? The library works fine outside of Unity and when LD_LIBRARY_PATH is set to the folder with all the .so files.

    Could the problem have to do with the .so.1 extension somehow?
     
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Unity doesn't even support netcoreapp3.0 assemblies, so that's definitely not the issue.

    I don't think that assumption can be made easily. I've seen cases of Linux loader shenanigans where the instruction pointer would end up in a totally different module than the caller. That's why I wondered if you could check which module is frame #0 part of.

    Please do.

    That is my suspicion based on the callstack you linked. We had quite a few crashes due to this issue before. Dynamic linking rules on Linux are weird, and it especially gets bad when certain functions are inlined and others are linked. First step in troubleshooting this is figuring out exactly which .so file the functions that crash are in.
     
  16. sam_dyno

    sam_dyno

    Joined:
    Dec 7, 2019
    Posts:
    6
    Do you have any suggestion for tools or some other way to figure out exactly which .so file the crash happens in? Have not been able to get much clarity from looking at the Player/Editor logs or at gdb backtraces like the callstack I posted earlier.

    Will try to get whatever info I can from the current project in any case. Does it matter if the crashes are from the Player or Editor in terms of this debugging?
     
  17. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    GDB should give you that info. If you type "info sharedlibrary", it will list all loaded modules along with the addresses they're loaded at. Then you can match them with instruction pointer of the crash.

    The process should be the same for player and editor.
     
  18. sam_dyno

    sam_dyno

    Joined:
    Dec 7, 2019
    Posts:
    6
    Sorry about not getting back to you earlier about this.

    I ran gdb for the Editor and got this for the crash during startup:

    warning: Could not load shared library symbols for Assets/Plugins/Linux/x86_64/libfastcdr.so.
    Do you need "set solib-search-path" or "set sysroot"?
    warning: Could not load shared library symbols for Assets/Plugins/Linux/x86_64/libfastrtps.so.
    Do you need "set solib-search-path" or "set sysroot"?

    Thread 1 "Unity" received signal SIGSEGV, Segmentation fault.
    __strcmp_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:31
    31 ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: No such file or directory.
    (gdb) backtrace
    #0 0x00007fffe888be8a in __strcmp_sse2_unaligned ()
    at ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:31
    #1 0x0000555559e53c8a in getrn ()
    #2 0x0000555559e53fc0 in lh_insert ()
    #3 0x0000555559e25bf7 in OBJ_NAME_add ()
    #4 0x00007fff0c38be5e in () at /usr/lib/x86_64-linux-gnu/libssl.so.1.1
    #5 0x00007fffe8be2827 in __pthread_once_slow (once_control=0x7fff0c5e4928, init_routine=0x7fff0c38bd70) at pthread_once.c:116
    #6 0x00007ffeec50d8f9 in CRYPTO_THREAD_run_once () at /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
    #7 0x00007fff0c38c07b in OPENSSL_init_ssl () at /usr/lib/x86_64-linux-gnu/libssl.so.1.1
    #8 0x00007fff2c2ebb7e in ()
    #9 0x0000000000000001 in ()
    #10 0x00007fff2c7d4900 in ()
    #11 0x00007fff2c7c40b8 in ()
    #12 0x00007fffffffdd48 in ()
    #13 0x000055555d428d90 in ()
    #14 0x00007fff2c1d3a24 in ()
    #15 0x0000000000000001 in ()
    #16 0xff8c1ea50355e900 in ()
    #17 0x000055555d428d90 in ()
    #18 0x0000000000000000 in ()

    (gdb) info sharedlibrary
    From To Syms Read Shared Object Library
    0x00007ffff7dd5f10 0x00007ffff7df4b20 Yes /lib64/ld-linux-x86-64.so.2
    0x00007ffff758d2c0 0x00007ffff7895058 Yes (*) /home/dyno/Unity/Hub/Editor/2019.2.8f1/Editor/Data/Tools/libfreeimage.so.3
    0x00007ffff71fa6e0 0x00007ffff7331c28 Yes (*) /home/dyno/Unity/Hub/Editor/2019.2.8f1/Editor/libispc_texcomp.so
    0x00007ffff6473330 0x00007ffff6d76598 Yes (*) /home/dyno/Unity/Hub/Editor/2019.2.8f1/Editor/libfbxsdk.so
    0x00007ffff26d08b0 0x00007ffff51acfaf Yes (*) /home/dyno/Unity/Hub/Editor/2019.2.8f1/Editor/libcef.so
    0x00007ffff1137b30 0x00007ffff1b28c60 Yes /home/dyno/Unity/Hub/Editor/2019.2.8f1/Editor/Data/Tools/libRL.so
    0x00007ffff010a6c0 0x00007ffff0db0ae2 Yes (*) /home/dyno/Unity/Hub/Editor/2019.2.8f1/Editor/Data/Tools/libembree.so.2
    0x00007fffefe8add0 0x00007fffefea6198 Yes /home/dyno/Unity/Hub/Editor/2019.2.8f1/Editor/Data/Tools/libtbbmalloc.so.2
    0x00007fffefc3d950 0x00007fffefc6a438 Yes /home/dyno/Unity/Hub/Editor/2019.2.8f1/Editor/Data/Tools/libtbb.so.2
    0x00007fffefa287f0 0x00007fffefa2a8e7 Yes (*) /home/dyno/Unity/Hub/Editor/2019.2.8f1/Editor/Data/Tools/libOpenCL.so.1
    0x00007fffef537e30 0x00007fffef7684e0 Yes /home/dyno/Unity/Hub/Editor/2019.2.8f1/Editor/libumbraoptimizer64.so
    0x00007fffecec8b00 0x00007fffed17c71c Yes (*) /home/dyno/Unity/Hub/Editor/2019.2.8f1/Editor/Data/Tools/libOpenImageDenoise.so.0
    0x00007fffecc67e50 0x00007fffecc68bde Yes /lib/x86_64-linux-gnu/libdl.so.2
    0x00007fffeca61200 0x00007fffeca6470c Yes /lib/x86_64-linux-gnu/librt.so.1
    0x00007fffec762490 0x00007fffec811b4e Yes (*) /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    0x00007fffec46b5a0 0x00007fffec4bd9b3 Yes (*) /usr/lib/x86_64-linux-gnu/libGLU.so.1
    0x00007fffec21b3d0 0x00007fffec21e70f Yes (*) /usr/lib/x86_64-linux-gnu/libGL.so.1
    0x00007fffebebb7c0 0x00007fffebf42828 Yes (*) /usr/lib/x86_64-linux-gnu/libX11.so.6
    0x00007fffebc94590 0x00007fffebc9e39f Yes (*) /usr/lib/x86_64-linux-gnu/libXext.so.6
    0x00007fffeba89320 0x00007fffeba8dd40 Yes (*) /usr/lib/x86_64-linux-gnu/libXcursor.so.1
    0x00007fffeb87dc00 0x00007fffeb883cf5 Yes (*) /usr/lib/x86_64-linux-gnu/libXrandr.so.2
    0x00007fffeafffc20 0x00007fffeb33c109 Yes (*) /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
    0x00007fffeaca9630 0x00007fffead1ce67 Yes (*) /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
    0x00007fffeaa758e0 0x00007fffeaa7a90e Yes (*) /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0
    0x00007fffea830b30 0x00007fffea851916 Yes (*) /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
    0x00007fffea608210 0x00007fffea61529f Yes (*) /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0
    0x00007fffea3f8300 0x00007fffea3f9279 Yes (*) /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2
    0x00007fffea0ea280 0x00007fffea1b4a76 Yes (*) /usr/lib/x86_64-linux-gnu/libcairo.so.2
    0x00007fffe9eba2b0 0x00007fffe9ece2d4 Yes (*) /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
    0x00007fffe9b4d180 0x00007fffe9c2fed2 Yes (*) /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
    0x00007fffe98cc0b0 0x00007fffe98fde6e Yes (*) /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
    0x00007fffe96bf620 0x00007fffe96bf77a Yes (*) /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0
    0x00007fffe93c3040 0x00007fffe943d1de Yes (*) /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
    0x00007fffe9015a80 0x00007fffe90d42f5 Yes /lib/x86_64-linux-gnu/libm.so.6
    0x00007fffe8df4ac0 0x00007fffe8e053fd Yes (*) /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x00007fffe8bd8bb0 0x00007fffe8be70f1 Yes /lib/x86_64-linux-gnu/libpthread.so.0
    0x00007fffe88032d0 0x00007fffe897bc3c Yes /lib/x86_64-linux-gnu/libc.so.6
    0x00007fffe84b4f30 0x00007fffe85a043c Yes (*) /usr/lib/x86_64-linux-gnu/libnss3.so
    0x00007fffe827ac70 0x00007fffe828afd8 Yes (*) /usr/lib/x86_64-linux-gnu/libnssutil3.so
    0x00007fffe804beb0 0x00007fffe80644d2 Yes (*) /usr/lib/x86_64-linux-gnu/libsmime3.so
    0x00007fffe7e3f350 0x00007fffe7e40a81 Yes (*) /usr/lib/x86_64-linux-gnu/libplc4.so
    0x00007fffe7c0c5b0 0x00007fffe7c2c82f Yes (*) /usr/lib/x86_64-linux-gnu/libnspr4.so
    ---Type <return> to continue, or q <return> to quit---
    0x00007fffe79c2e00 0x00007fffe79e2a8a Yes (*) /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
    0x00007fffe77137f0 0x00007fffe778c2e4 Yes (*) /usr/lib/x86_64-linux-gnu/libfreetype.so.6
    0x00007fffe74fa180 0x00007fffe75049d7 Yes (*) /usr/lib/x86_64-linux-gnu/libXi.so.6
    0x00007fffe72f5c40 0x00007fffe72f6665 Yes (*) /usr/lib/x86_64-linux-gnu/libXcomposite.so.1
    0x00007fffe7018e50 0x00007fffe70af0bf Yes (*) /usr/lib/x86_64-linux-gnu/libasound.so.2
    0x00007fffe6debb60 0x00007fffe6dec44b Yes (*) /usr/lib/x86_64-linux-gnu/libXdamage.so.1
    0x00007fffe6be6540 0x00007fffe6be8876 Yes (*) /usr/lib/x86_64-linux-gnu/libXfixes.so.3
    0x00007fffe69e0400 0x00007fffe69e2d9b Yes (*) /usr/lib/x86_64-linux-gnu/libXtst.so.6
    0x00007fffe67b9180 0x00007fffe67d1655 Yes (*) /usr/lib/x86_64-linux-gnu/libgconf-2.so.4
    0x00007fffe6581840 0x00007fffe659e093 Yes (*) /lib/x86_64-linux-gnu/libexpat.so.1
    0x00007fffe6375a60 0x00007fffe637bab5 Yes (*) /usr/lib/x86_64-linux-gnu/libXrender.so.1
    0x00007fffe61058b0 0x00007fffe614ee40 Yes (*) /usr/lib/x86_64-linux-gnu/libcups.so.2
    0x00007fffe5ee3810 0x00007fffe5ee51a7 Yes (*) /lib/x86_64-linux-gnu/libcap.so.2
    0x00007fffe5ca01e0 0x00007fffe5ccbb11 Yes (*) /lib/x86_64-linux-gnu/libdbus-1.so.3
    0x00007fffe5a66fb0 0x00007fffe5a70b45 Yes (*) /usr/lib/x86_64-linux-gnu/libGLX.so.0
    0x00007fffe57ecb60 0x00007fffe57ef9e7 Yes (*) /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0
    0x00007fffe5591150 0x00007fffe55a3565 Yes (*) /usr/lib/x86_64-linux-gnu/libxcb.so.1
    0x00007fffe5383110 0x00007fffe5384006 Yes (*) /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0
    0x00007fffe515d560 0x00007fffe51716de Yes (*) /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0
    0x00007fffe4eabc90 0x00007fffe4ef0d71 Yes (*) /usr/lib/x86_64-linux-gnu/libepoxy.so.0
    0x00007fffe4c41130 0x00007fffe4c496fd Yes (*) /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
    0x00007fffe4a37af0 0x00007fffe4a383ec Yes (*) /usr/lib/x86_64-linux-gnu/libXinerama.so.1
    0x00007fffe47fc010 0x00007fffe4816b3a Yes (*) /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0
    0x00007fffe45f1190 0x00007fffe45f2caf Yes (*) /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0
    0x00007fffe43ee640 0x00007fffe43ee7d6 Yes (*) /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1
    0x00007fffe41e3ff0 0x00007fffe41e8def Yes (*) /usr/lib/x86_64-linux-gnu/libwayland-client.so.0
    0x00007fffe3fd7c20 0x00007fffe3fdb683 Yes (*) /usr/lib/x86_64-linux-gnu/libthai.so.0
    0x00007fffe3d3ab50 0x00007fffe3dbddc0 Yes (*) /usr/lib/x86_64-linux-gnu/libpixman-1.so.0
    0x00007fffe3b034e0 0x00007fffe3b252b8 Yes (*) /usr/lib/x86_64-linux-gnu/libpng16.so.16
    0x00007fffe38fcd50 0x00007fffe38fd843 Yes (*) /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0
    0x00007fffe36f3cb0 0x00007fffe36f86e8 Yes (*) /usr/lib/x86_64-linux-gnu/libxcb-render.so.0
    0x00007fffe34d3f90 0x00007fffe34e7640 Yes (*) /lib/x86_64-linux-gnu/libz.so.1
    0x00007fffe32b0210 0x00007fffe32c74cf Yes (*) /lib/x86_64-linux-gnu/libselinux.so.1
    0x00007fffe3092830 0x00007fffe30a2152 Yes /lib/x86_64-linux-gnu/libresolv.so.2
    0x00007fffe2e45b30 0x00007fffe2e7adce Yes (*) /lib/x86_64-linux-gnu/libmount.so.1
    0x00007fffe2c34740 0x00007fffe2c3900a Yes (*) /usr/lib/x86_64-linux-gnu/libffi.so.6
    0x00007fffe29c2520 0x00007fffe2a134cd Yes (*) /lib/x86_64-linux-gnu/libpcre.so.3
    0x00007fffe27bdd80 0x00007fffe27bea88 Yes (*) /usr/lib/x86_64-linux-gnu/libplds4.so
    0x00007fffe259fb40 0x00007fffe25b1cea Yes (*) /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2
    0x00007fffe23566e0 0x00007fffe2386e36 Yes (*) /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2
    0x00007fffe200e780 0x00007fffe20f5e7a Yes (*) /usr/lib/x86_64-linux-gnu/libgnutls.so.30
    0x00007fffe1ddce90 0x00007fffe1de1f59 Yes (*) /usr/lib/x86_64-linux-gnu/libavahi-common.so.3
    0x00007fffe1bcc6c0 0x00007fffe1bd46ad Yes (*) /usr/lib/x86_64-linux-gnu/libavahi-client.so.3
    0x00007fffe1952380 0x00007fffe19a8e64 Yes (*) /lib/x86_64-linux-gnu/libsystemd.so.0
    0x00007fffe1741e50 0x00007fffe1742acc Yes (*) /usr/lib/x86_64-linux-gnu/libXau.so.6
    0x00007fffe153c110 0x00007fffe153da18 Yes (*) /usr/lib/x86_64-linux-gnu/libXdmcp.so.6
    0x00007fffe13196e0 0x00007fffe132b5e8 Yes (*) /usr/lib/x86_64-linux-gnu/libatspi.so.0
    0x00007fffe10740c0 0x00007fffe10d16ae Yes (*) /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0
    0x00007fffe0e670c0 0x00007fffe0e6a420 Yes (*) /usr/lib/x86_64-linux-gnu/libdatrie.so.1
    0x00007fffe0c22830 0x00007fffe0c511ce Yes (*) /lib/x86_64-linux-gnu/libblkid.so.1
    0x00007fffe09647d0 0x00007fffe09c0f1a Yes (*) /usr/lib/x86_64-linux-gnu/libkrb5.so.3
    0x00007fffe0715350 0x00007fffe07319c0 Yes (*) /usr/lib/x86_64-linux-gnu/libk5crypto.so.3
    0x00007fffe050e380 0x00007fffe050eeea Yes (*) /lib/x86_64-linux-gnu/libcom_err.so.2
    0x00007fffe0304740 0x00007fffe030968c Yes (*) /usr/lib/x86_64-linux-gnu/libkrb5support.so.0
    ---Type <return> to continue, or q <return> to quit---
    0x00007fffdfffe350 0x00007fffe009116f Yes (*) /usr/lib/x86_64-linux-gnu/libp11-kit.so.0
    0x00007fffdfdb74f0 0x00007fffdfdbb1c3 Yes (*) /usr/lib/x86_64-linux-gnu/libidn2.so.0
    0x00007fffdfa47580 0x00007fffdfa7bcb3 Yes (*) /usr/lib/x86_64-linux-gnu/libunistring.so.2
    0x00007fffdf827990 0x00007fffdf832693 Yes (*) /usr/lib/x86_64-linux-gnu/libtasn1.so.6
    0x00007fffdf5f70e0 0x00007fffdf6132ef Yes (*) /usr/lib/x86_64-linux-gnu/libnettle.so.6
    0x00007fffdf3c1a20 0x00007fffdf3cfddf Yes (*) /usr/lib/x86_64-linux-gnu/libhogweed.so.4
    0x00007fffdf143380 0x00007fffdf1a2438 Yes (*) /usr/lib/x86_64-linux-gnu/libgmp.so.10
    0x00007fffdef168e0 0x00007fffdef2d3e2 Yes (*) /lib/x86_64-linux-gnu/liblzma.so.5
    0x00007fffdecf9da0 0x00007fffded11386 Yes (*) /usr/lib/x86_64-linux-gnu/liblz4.so.1
    0x00007fffde9e8c00 0x00007fffdeab4b38 Yes (*) /lib/x86_64-linux-gnu/libgcrypt.so.20
    0x00007fffde7cb450 0x00007fffde7d834f Yes (*) /lib/x86_64-linux-gnu/libbsd.so.0
    0x00007fffde59d480 0x00007fffde5c0af5 Yes (*) /usr/lib/x86_64-linux-gnu/libgraphite2.so.3
    0x00007fffde395640 0x00007fffde398f19 Yes (*) /lib/x86_64-linux-gnu/libuuid.so.1
    0x00007fffde1912d0 0x00007fffde191ecc Yes (*) /lib/x86_64-linux-gnu/libkeyutils.so.1
    0x00007fffddf7dbe0 0x00007fffddf87d48 Yes (*) /lib/x86_64-linux-gnu/libgpg-error.so.0
    0x00007fffdc2d2e30 0x00007fffdc616e38 Yes (*) /usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.1
    0x00007fffdbfc4c30 0x00007fffdbff3fb8 Yes (*) /usr/lib/x86_64-linux-gnu/libnvidia-fatbinaryloader.so.435.21
    0x00007fffd4efa510 0x00007fffd5218848 Yes (*) /usr/lib/x86_64-linux-gnu/libcuda.so.1
    0x00007fffbc3df8c0 0x00007fffbc3f19e3 Yes (*) /lib/x86_64-linux-gnu/libudev.so.1
    0x00007fffbc1d2b90 0x00007fffbc1d7b6e Yes (*) /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
    0x00007fffb5a85d20 0x00007fffb5aa08af Yes (*) /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so
    0x00007fffb584f930 0x00007fffb5866955 Yes (*) /usr/lib/x86_64-linux-gnu/gvfs/libgvfscommon.so
    0x00007fffb5627670 0x00007fffb563330b Yes (*) /usr/lib/x86_64-linux-gnu/gio/modules/libgioremote-volume-monitor.so
    0x00007fffb4419050 0x00007fffb441b1a0 Yes (*) /usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libcanberra-gtk-module.so
    0x00007fffb4213bb0 0x00007fffb421518e Yes (*) /usr/lib/x86_64-linux-gnu/libcanberra-gtk3.so.0
    0x00007fffb4002a50 0x00007fffb400c00a Yes (*) /usr/lib/x86_64-linux-gnu/libcanberra.so.0
    0x00007fffafdf9cd0 0x00007fffafdfe08c Yes (*) /usr/lib/x86_64-linux-gnu/libvorbisfile.so.3
    0x00007fffafbe5260 0x00007fffafbf0e52 Yes (*) /usr/lib/x86_64-linux-gnu/libtdb.so.1
    0x00007fffaf9d9eb0 0x00007fffaf9de272 Yes (*) /usr/lib/x86_64-linux-gnu/libltdl.so.7
    0x00007fffaf7afce0 0x00007fffaf7c5a82 Yes (*) /usr/lib/x86_64-linux-gnu/libvorbis.so.0
    0x00007fffaf5a5a70 0x00007fffaf5a9c05 Yes (*) /usr/lib/x86_64-linux-gnu/libogg.so.0
    0x00007fffaf39e6c0 0x00007fffaf3a0a5b Yes (*) /usr/lib/x86_64-linux-gnu/libnotify.so.4
    0x00007fffaf197ec0 0x00007fffaf199db9 Yes (*) /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so
    0x00007fffac2c5b10 0x00007fffac2f2672 Yes (*) /usr/lib/x86_64-linux-gnu/libpulse.so.0
    0x00007fffac04df00 0x00007fffac092afe Yes (*) /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so
    0x00007fffa1df4cd0 0x00007fffa1df8867 Yes (*) /lib/x86_64-linux-gnu/libwrap.so.0
    0x00007fffa1b7f750 0x00007fffa1bd0435 Yes (*) /usr/lib/x86_64-linux-gnu/libsndfile.so.1
    0x00007fffa19741d0 0x00007fffa1976848 Yes (*) /usr/lib/x86_64-linux-gnu/libasyncns.so.0
    0x00007fffa175d090 0x00007fffa176a807 Yes /lib/x86_64-linux-gnu/libnsl.so.1
    0x00007fffa14ea170 0x00007fffa154d2db Yes (*) /usr/lib/x86_64-linux-gnu/libFLAC.so.8
    0x00007fffa124ca00 0x00007fffa124f12c Yes (*) /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2
    0x00007fff6c5bb190 0x00007fff6c5e7fac Yes (*) /usr/lib/x86_64-linux-gnu/nss/libsoftokn3.so
    0x00007fff6c2bacc0 0x00007fff6c385870 Yes (*) /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
    0x00007fff6c025740 0x00007fff6c08596d Yes (*) /usr/lib/x86_64-linux-gnu/nss/libfreeblpriv3.so
    0x00007fff4ed94fd0 0x00007fff4eda3d0f Yes (*) /usr/lib/x86_64-linux-gnu/nss/libnssckbi.so
    0x00007fff4c3705c0 0x00007fff4c3717dc Yes (*) /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0
    No Assets/Plugins/Linux/x86_64/libfastcdr.so
    ---Type <return> to continue, or q <return> to quit---
    No Assets/Plugins/Linux/x86_64/libfastrtps.so
    0x00007fff0c5eb910 0x00007fff0c5f3545 Yes (*) /usr/lib/x86_64-linux-gnu/libtinyxml2.so.6
    0x00007fff0c375590 0x00007fff0c3befc6 Yes (*) /usr/lib/x86_64-linux-gnu/libssl.so.1.1
    0x00007ffeec3a6000 0x00007ffeec53c38e Yes (*) /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
    (*): Shared library is missing debugging information.
    (gdb)

    As you can see, there are no addresses for libfastcdr.so and libfastrtps.so and "Syms Read" field is "No".
    Not sure if this is because they don't have debug symbols if it means something different.

    If I only select preload for libfastrtps.so I get no crash on startup, but I do get this warning in the Editor Console:
    Plugins: Couldn't open Assets/Plugins/Linux/x86_64/libfastrtps.so, error: libfastcdr.so.1: cannot open shared object file: No such file or directory


    Selecting "Load on startup" for libfastcdr.so immediately causes a "Unity has stopped working" dialog to appear. I submitted a bug report from this crash using "Unity Bug Reporter".

    Sourcecode for the library is here: https://github.com/osrf/libfastcdr
     
    Last edited: Dec 12, 2019
  19. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Thanks for the bug report! This indeed sounds tricky/complicated...
     
  20. AdamDabrowski

    AdamDabrowski

    Joined:
    Nov 14, 2019
    Posts:
    1
    There are two separate bugs here I believe: one related to libfastrtps (issue with symbols, perhaps some part not compiled with -pic flag), the second one to Unity (or mono), with libdl. Someone made a hack there that cuts the lookup name from libdl.so to libdl (probably intended to cut the version only). I managed to fix both issues in our ROS2 Unity plugin.

    I am curious what the follow up was for you
     
  21. dyno_sam

    dyno_sam

    Joined:
    Jan 14, 2020
    Posts:
    2
    I managed to get it working by building ROS2 eloquent from scratch with only one DDS implementation to avoid dynamic linking using POCO. It works without the need for a local ROS2 install and can be started using Unity Hub. Only for cyclone DDS though, I still have some issues with fastrtps.
     
    AdamDabrowski likes this.
  22. eprosima-MiguelCompany

    eprosima-MiguelCompany

    Joined:
    Jul 20, 2020
    Posts:
    2
    Hi,

    I am one of the developers of libfastrtps. We have been investigating this, and it seems we have found the issue:

    First libfastrtps.so calls OPENSSL_init_ssl () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
    Which then calls CRYPTO_THREAD_run_once () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
    At some point an indeterminate function is called from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
    Which then calls OBJ_NAME_add () from UnityPlayer.so !!!!

    Shouldn't last one be called from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ?

    Adding /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 to LD_PRELOAD seems to workaround the issue.

    It seems that UnityPlayer.so is linking openssl statically and is exporting the symbols. It could built it differently to avoid that. See here for an example.
     
  23. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Thanks. Looks like the original bug report never reached us and it got dropped on the floor :(. Unity is indeed statically linking a version of OpenSSL. And the fact that it exports symbols is a bug.

    Which version of Unity was this on? I tried getting QA to repro it but none of them could.
     
  24. eprosima-MiguelCompany

    eprosima-MiguelCompany

    Joined:
    Jul 20, 2020
    Posts:
    2
    According to the original post

     
  25. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Thanks. We're fixing it.
     
  26. unity_7WRqUg_0R3iuog

    unity_7WRqUg_0R3iuog

    Joined:
    Nov 21, 2020
    Posts:
    1
    Hello, Has this issue been resolved?
    I am trying to use IsaacSim Unity3d 2019.3.15f1 from Nvidia on the Ubu1804. I am seeing the same error with regards to libdl.so. See attached snapshot.
    Please advise.
    Regard.
    Kunal Vora
     

    Attached Files:

  27. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    2019.3.15f1 was released on May 28, 2020, which was before this was discovered. I suggest upgrading to latest 2019.4 build.