-
-
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
debuginfo: tweak the order of get_function_name_and_base and dladdr on FreeBSD #22547
Conversation
…n FreeBSD There is a known bug in FreeBSD's dladdr(3): (Quote from manual dladdr(3)) In dynamically linked programs, the address of a global function is considered to point to its program linkage table entry, rather than to the entry point of the function itself. This causes most global functions to appear to be defined within the main executable, rather than in the shared libraries where the actual code resides. Function `get_function_name_and_base` implemented in PR JuliaLang#22472 provides a (slow but cross-platform) way to lookup function name and base address via LLVM. @yuyichao propose that getting info from `get_function_name_and_base` first and making original `dladdr` as fallback. Fix: JuliaLang#20798 See also: JuliaLang#22472 (comment)
That's not the issue. We are not hitting the P.S. don't mention people in the commit message. It'll create a notification everytime the commit is rebased. |
@@ -734,7 +734,7 @@ static void get_function_name_and_base(const object::ObjectFile *object, bool in | |||
saddr = nullptr; | |||
// Try platform specific methods first since they are usually faster | |||
if (saddr && !*saddr) { | |||
#if defined(_OS_LINUX_) && !defined(JL_DISABLE_LIBUNWIND) | |||
#if (defined(_OS_LINUX_) || defined(_OS_FREEBSD_)) && !defined(JL_DISABLE_LIBUNWIND) |
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.
Does this mean that the answer to the question I asked in #20798 (comment)
see if the libunwind on FreeBSD support that too
is yes?
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.
I just print *saddr
in (https://github.com/JuliaLang/julia/pull/22547/files/2ca716c3bb406b99a26ef4e556f4b41455ae93e6#diff-d4b80bf89e46982070f234dd7cc344a9R740)
and it did get something.
(Not strictly verified the source of libunwind
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.
I just mean that the function does exist.
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.
By observing it in gdb, the values from pip
are fine.
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.
I just mean that the function does exist.
yes, it's available.
There is a known bug in FreeBSD's dladdr(3):
(Quote from manual dladdr(3))
Function
get_function_name_and_base
implemented in PR #22472 providesa (slow but cross-platform) way to lookup function name and base address
via LLVM.
@yuyichao proposes that getting info from
get_function_name_and_base
first and making original
dladdr
as fallback.Fix: #20798
See also: #22472 (comment)
Once this issue get fixed,
test-file
will become the last blocker of FreeBSD CI. :)