-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libdl.so
not found in search path and causes a crash
#53291
Comments
Tagging subscribers to this area: @carlossanlop Issue DetailsDescriptionTrying out the .NET 6 preview 4, I'm not able to run my application anymore due to a crash. Configuration
Regression?Worked on .NET 5, so yes. Other informationRunning the app itself gives a segfault:
GDB shows that it's an issue with dlopen:
strace shows that it's trying to find
How to fix?
|
Looking at the dump above, I can see that it has succeeded loading the libdl: |
You're right, thanks for spotting that lldb shows the following:
|
We will need to get symbols for the libdl.so and libc6 to see more. Can you please install |
It seems it's already installed. How to point it to the symbols?
|
can you please try the following lldb commands before executing the
|
Sure, here it is:
|
Ok, great. Can you please run these lldb commands?
|
|
Thank you, now the following please:
|
(I am trying to find out where the callq *rax would go) |
Yep sure - it says:
|
Ok, so now:
|
|
Ok, here we go, that's the address it would call and it is really zero. It looks like the code is this:
|
Hmm:
|
If it helps, my project is open source located @ https://github.com/health-validator/Hammer/tree/test-net6.0. |
Ok, great, I can try to check it myself. I suspect snap being related to the issue.
|
For certain, here it is:
|
I can see that it uses |
Hmm. I'm using https://github.com/qmlnet/qmlnet which I'm not very familiar with, but I know that it does a few things differently under the hood in order to deliver better performance and avoid pinvoke all the time. |
I believe that's the problem. See the comment in this section:
notice that you get the same soname for the libdl.so:
this is because the libdl.so is just a symlink to the libdl.so.2
However, the strange thing is that the qmlnet seems to refer to the libdl.so only here: Which is a macOS stuff. |
I am testing it with a dotnet installed without snap, but it seems that the issue actually comes from here:
|
It seems that the NetNativeLibLoader needs to be fixed to handle Linux and other Unixes differently and use |
Thanks so much for the detailed explanation! Sounds like it was a fluke before that it was working with .NET < 5 then? |
Is it possible that you were testing the .NET < 5 version installed without snap? That would explain why it worked, as it would use only libraries from the current OS. Actually, you can use a non-snap version of .NET 5 and you would not hit the issue, if it is an option for you. |
Yep - that worked, thank you. I only used snap since it was the simplest to install, but installing the .tar.gz's by hand was not bad at all. I'll submit the loading issue to QML.NET as well. Really appreciate the in-depth investigation @janvorli, you went above and beyond! |
Since there is nothing we can do on our end and the issue has been reported in the faulty project (pauldotknopf/net-native-lib-loader#3) I am going to close the issue. Thanks! |
Description
Trying out the .NET 6 preview 4, I'm not able to run my application anymore due to a crash.
Configuration
Regression?
Worked on .NET 5, so yes.
Other information
Running the app itself gives a segfault:
GDB shows that it's an issue with dlopen:
strace shows that it's trying to find
libdl.so
in all places except where it actually is (/lib/x86_64-linux-gnu/libdl.so.2
):How to fix?
The text was updated successfully, but these errors were encountered: