TL;DR: This is a building issue with the application, the application was incorrectly built and linked against libdl.so. For Linux support, the software must be rebuilt and linked to libdl.so.2 instead.
In this specific stack trace, the crash is in the C# pythonnet stack, fixed in pythonnet >= 3.0
More Explanation:
This is the standard glibc library. It's often linked automatically when binaries are created or it's often hardcoded in specific builds (the library is used to load further libraries).
The library is libdl.so.2 in Linux distributions (Debian, RHEL, Ubuntu, etc...). It was historically libdl.so in older operating systems and Unix variants.
Both have been coexisting for a while and causing confusion:
- On CentOS, libdl.so can be installed by
sudo yum install glibc-devel - On Debian and Ubuntu <=20, libdl.so can be installed by
sudo apt-get install libc6-dev - On Ubuntu >= 22, libdl.so no longer exists, it can't be installed by libc6-dev (nor gcc).
The dev glibc package is a transitive dependency of gcc. It's very common for gcc to be installed on Linux machines (developer machines and end-user machines alike), so it's very common for libdl.so to be accidentally available. It's not part of the base operating system and should not be expected to be available.
Software that have been linked to libdl.so will crash when the library is not available. It's a long standing issue. It's getting more noticeable due to Ubuntu 22 lately, it was only noticeable in containers and minimal OS install before (no gcc).
In this specific stack trace, the crash was in the C# pythonnet stack, the linking was fixed in pythonnet >= 3.0
Answer from user5994461 on Stack Overflow`libdl.so` not found in search path and causes a crash
dll - libdl.so not found on Ubuntu EC2 instance - Stack Overflow
Shared object "libdl.so.1" not found, required by "bash" | The FreeBSD Forums
Built executable won't run on Linux - libdl.so not found - Unity Engine - Unity Discussions
You can simply create a symbolic link like so:
$ whereis libdl.so.2
libdl.so.2: /usr/lib/libdl.so.2 /usr/lib32/libdl.so.2
$ sudo ln -s /usr/lib/libdl.so.2 /usr/lib/libdl.so
$ sudo ln -s /usr/lib32/libdl.so.2 /usr/lib32/libdl.so
In my case that's enough for MonoGame.
First step, you should check which libraries (with exact versions) are required for the build.
The dl library is now part of the C standard library. The release notes, tells that, starting from version 2.34, which is yours,
...all functionality formerly implemented in the libraries libpthread, libdl, libutil, libanl has been integrated into libc. New applications do not need to link with -lpthread, -ldl, -lutil, -lanl anymore. For backwards compatibility, empty static archives libpthread.a, libdl.a, libutil.a, libanl.a are provided, so that the linker options keep working. Applications which have been linked against glibc 2.33 or earlier continue to load the corresponding shared objects (which are now empty).
This means that you have to pick an older version of the libc library (before 2.34), typically on an older OS version, or if you know what you are doing, tweak your Makefile (to remove the explicit libdl.so requirement).
I also ran into this on 64bit ubuntu, gcc 4.6.3, my hunch was the ordering of link lib. However, the same thing builds on 32bit. I added -ldl at the end of the link command and it linked, so looks like some sort of linker issue. You can also set env var: LIBS=-ldl, from shell and it will build.
Because ld.so.conf is for the dynamic linker, not the post-assembly linker, ld(1). Someone created this new path, but did not update the directories that the linker searches. there should be a link in /lib64 or /usr/lib64 for libdl, or one of the the paths that the linker searches for linking 64bit objects.
This (new path) is another example, from my PoV, of random changes that various Linux distros make without fully understanding the consequences or history.