-
-
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
dllist()
returns no items on FreeBSD
#50846
Comments
Just to make sure we're not barking up the wrong tree, have you tried manually reverting that change (reordering the |
Yes, that's how I was able to determine that it was the reordering that caused the breakage. |
It seems that $ readelf -sW /lib/libc.so.7 | grep dl_iterate_phdr
840: 0000000000094fe0 199 FUNC WEAK DEFAULT 13 dl_iterate_phdr@@FBSD_1.0 (2)
$ readelf -sW /libexec/ld-elf.so.1 | grep dl_iterate_phdr
10: 000000000000cfa0 748 FUNC GLOBAL DEFAULT 12 dl_iterate_phdr@@FBSD_1.0 (2) Compare to Linux: $ readelf -sW /lib/x86_64-linux-gnu/libc.so.6 | grep dl_iterate_phdr
1138: 0000000000174d30 532 FUNC WEAK DEFAULT 15 dl_iterate_phdr@@GLIBC_2.2.5
$ readelf -sW /lib64/ld-linux-x86-64.so.2 | grep dl_iterate_phdr
(nothing) After #50162, we end up resolving to the |
In your PR, you noted
Can you elaborate on what that scenario is and how the prior ordering caused issues? The simplest "solution" to this issue is to add an |
Turned out to be an upstream bug (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272992), now fixed. Found by @topolarity |
I still want to merge a small fix for this on our side, since that fix is not available in any stable FreeBSD release yet |
ELF doesn't handle WEAK symbols dynamically the way it handles them statically. Looking up overloaded WEAK symbols via a library-specific handle will often give you the empty stub (in `libc.so.7` in this case) instead of the strong implementation elsewhere (`ld-elf.so.1` here). Even after the [upstream fix](https://cgit.freebsd.org/src/commit/?id=21a52f99440c9bec7679f3b0c5c9d888901c3694), `dlsym`, `dladdr` and a ton of other symbols still have stubs with no trampoline in FreeBSD's libc: https://cgit.freebsd.org/src/tree/lib/libc/gen/dlfcn.c?id=21a52f99440c9bec7679f3b0c5c9d888901c3694 Thankfully `dl_iterate_phdr` appears to be the only function that we directly `ccall` from Julia's Libdl so we can leave this fix incomplete for now. Resolves #50846.
ELF doesn't handle WEAK symbols dynamically the way it handles them statically. Looking up overloaded WEAK symbols via a library-specific handle will often give you the empty stub (in `libc.so.7` in this case) instead of the strong implementation elsewhere (`ld-elf.so.1` here). Even after the [upstream fix](https://cgit.freebsd.org/src/commit/?id=21a52f99440c9bec7679f3b0c5c9d888901c3694), `dlsym`, `dladdr` and a ton of other symbols still have stubs with no trampoline in FreeBSD's libc: https://cgit.freebsd.org/src/tree/lib/libc/gen/dlfcn.c?id=21a52f99440c9bec7679f3b0c5c9d888901c3694 Thankfully `dl_iterate_phdr` appears to be the only function that we directly `ccall` from Julia's Libdl so we can leave this fix incomplete for now. Resolves #50846. (cherry picked from commit c659011)
ELF doesn't handle WEAK symbols dynamically the way it handles them statically. Looking up overloaded WEAK symbols via a library-specific handle will often give you the empty stub (in `libc.so.7` in this case) instead of the strong implementation elsewhere (`ld-elf.so.1` here). Even after the [upstream fix](https://cgit.freebsd.org/src/commit/?id=21a52f99440c9bec7679f3b0c5c9d888901c3694), `dlsym`, `dladdr` and a ton of other symbols still have stubs with no trampoline in FreeBSD's libc: https://cgit.freebsd.org/src/tree/lib/libc/gen/dlfcn.c?id=21a52f99440c9bec7679f3b0c5c9d888901c3694 Thankfully `dl_iterate_phdr` appears to be the only function that we directly `ccall` from Julia's Libdl so we can leave this fix incomplete for now. Resolves #50846. (cherry picked from commit c659011)
With Julia 1.9.2 on FreeBSD 13.2,
dllist()
returns 42 entries. With 1.10.0-beta1 andmaster
, it incorrectly returns 0 entries. Thelibdl
andbinaryplatform
tests are failing for this reason. This is a regression introduced by #50162. Specifically, reordering the sources for symbol lookup to put the exe last caused this; the sanitizer parts of that PR are unrelated.The text was updated successfully, but these errors were encountered: