-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Better Libdl.dlopen error when using non-standard extension #46998
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When trying to dlopen a file with non-standard extension (e.g. `foo.so` instead of `foo.dylib` when running on macOS), if this failed (e.g. because of a reference to an undefined symbol), then instead of printing the error message returned by `dlerror` with a helpful notice what went wrong, a message indicating something to the effect that "foo.so.dylib was not found" was shown, which was not helpful at all. To get the actual helpful error message, add a check so that when dlopen fails for a file that actually exists, we don't retry loading from a file with the standard extension attached, which might not even exist; instead we just give up. This matches what is already being done for relative paths. This patch simply copies the relevant check to also be applied to the case dealing with absolute paths.
I think it would be sensible to backport this. |
giordano
added
backport 1.6
Change should be backported to release-1.6
backport 1.8
Change should be backported to release-1.8
labels
Oct 2, 2022
vtjnash
approved these changes
Oct 3, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does look like it would be more consistent
Can this be merged? |
KristofferC
pushed a commit
that referenced
this pull request
Oct 27, 2022
When trying to dlopen a file with non-standard extension (e.g. `foo.so` instead of `foo.dylib` when running on macOS), if this failed (e.g. because of a reference to an undefined symbol), then instead of printing the error message returned by `dlerror` with a helpful notice what went wrong, a message indicating something to the effect that "foo.so.dylib was not found" was shown, which was not helpful at all. To get the actual helpful error message, add a check so that when dlopen fails for a file that actually exists, we don't retry loading from a file with the standard extension attached, which might not even exist; instead we just give up. This matches what is already being done for relative paths. This patch simply copies the relevant check to also be applied to the case dealing with absolute paths. (cherry picked from commit a490197)
37 tasks
KristofferC
pushed a commit
that referenced
this pull request
Oct 28, 2022
When trying to dlopen a file with non-standard extension (e.g. `foo.so` instead of `foo.dylib` when running on macOS), if this failed (e.g. because of a reference to an undefined symbol), then instead of printing the error message returned by `dlerror` with a helpful notice what went wrong, a message indicating something to the effect that "foo.so.dylib was not found" was shown, which was not helpful at all. To get the actual helpful error message, add a check so that when dlopen fails for a file that actually exists, we don't retry loading from a file with the standard extension attached, which might not even exist; instead we just give up. This matches what is already being done for relative paths. This patch simply copies the relevant check to also be applied to the case dealing with absolute paths. (cherry picked from commit a490197)
KristofferC
pushed a commit
that referenced
this pull request
Dec 21, 2022
When trying to dlopen a file with non-standard extension (e.g. `foo.so` instead of `foo.dylib` when running on macOS), if this failed (e.g. because of a reference to an undefined symbol), then instead of printing the error message returned by `dlerror` with a helpful notice what went wrong, a message indicating something to the effect that "foo.so.dylib was not found" was shown, which was not helpful at all. To get the actual helpful error message, add a check so that when dlopen fails for a file that actually exists, we don't retry loading from a file with the standard extension attached, which might not even exist; instead we just give up. This matches what is already being done for relative paths. This patch simply copies the relevant check to also be applied to the case dealing with absolute paths. (cherry picked from commit a490197)
78 tasks
KristofferC
pushed a commit
that referenced
this pull request
Dec 21, 2022
When trying to dlopen a file with non-standard extension (e.g. `foo.so` instead of `foo.dylib` when running on macOS), if this failed (e.g. because of a reference to an undefined symbol), then instead of printing the error message returned by `dlerror` with a helpful notice what went wrong, a message indicating something to the effect that "foo.so.dylib was not found" was shown, which was not helpful at all. To get the actual helpful error message, add a check so that when dlopen fails for a file that actually exists, we don't retry loading from a file with the standard extension attached, which might not even exist; instead we just give up. This matches what is already being done for relative paths. This patch simply copies the relevant check to also be applied to the case dealing with absolute paths. (cherry picked from commit a490197)
KristofferC
pushed a commit
that referenced
this pull request
Dec 21, 2022
When trying to dlopen a file with non-standard extension (e.g. `foo.so` instead of `foo.dylib` when running on macOS), if this failed (e.g. because of a reference to an undefined symbol), then instead of printing the error message returned by `dlerror` with a helpful notice what went wrong, a message indicating something to the effect that "foo.so.dylib was not found" was shown, which was not helpful at all. To get the actual helpful error message, add a check so that when dlopen fails for a file that actually exists, we don't retry loading from a file with the standard extension attached, which might not even exist; instead we just give up. This matches what is already being done for relative paths. This patch simply copies the relevant check to also be applied to the case dealing with absolute paths. (cherry picked from commit a490197)
staticfloat
pushed a commit
that referenced
this pull request
Dec 23, 2022
When trying to dlopen a file with non-standard extension (e.g. `foo.so` instead of `foo.dylib` when running on macOS), if this failed (e.g. because of a reference to an undefined symbol), then instead of printing the error message returned by `dlerror` with a helpful notice what went wrong, a message indicating something to the effect that "foo.so.dylib was not found" was shown, which was not helpful at all. To get the actual helpful error message, add a check so that when dlopen fails for a file that actually exists, we don't retry loading from a file with the standard extension attached, which might not even exist; instead we just give up. This matches what is already being done for relative paths. This patch simply copies the relevant check to also be applied to the case dealing with absolute paths. (cherry picked from commit a490197)
KristofferC
pushed a commit
that referenced
this pull request
Oct 10, 2023
When trying to dlopen a file with non-standard extension (e.g. `foo.so` instead of `foo.dylib` when running on macOS), if this failed (e.g. because of a reference to an undefined symbol), then instead of printing the error message returned by `dlerror` with a helpful notice what went wrong, a message indicating something to the effect that "foo.so.dylib was not found" was shown, which was not helpful at all. To get the actual helpful error message, add a check so that when dlopen fails for a file that actually exists, we don't retry loading from a file with the standard extension attached, which might not even exist; instead we just give up. This matches what is already being done for relative paths. This patch simply copies the relevant check to also be applied to the case dealing with absolute paths. (cherry picked from commit a490197)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When trying to dlopen a file with non-standard extension (e.g.
foo.so
instead offoo.dylib
when running on macOS), if this failed (e.g. because of a reference to an undefined symbol), then instead of printing the error message returned bydlerror
with a helpful notice what went wrong, a message indicating something to the effect that "foo.so.dylib was not found" was shown, which was not helpful at all.To get the actual helpful error message, add a check so that when dlopen fails for a file that actually exists, we don't retry loading from a file with the standard extension attached, which might not even exist; instead we just give up.
This matches what is already being done for relative paths. This patch simply copies the relevant check to also be applied to the case dealing with absolute paths.