-
Notifications
You must be signed in to change notification settings - Fork 228
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
Add support for debuginfod lookup/download of separate debuginfo #79
Comments
Hi Frank. The main issue is that libbacktrace is designed to run in a signal handler, which means it can't allocate memory using any standard mechanism like |
Although one issue is that I wouldn't want people to have unexpected waits before a backtrace is printed. That might be tolerable if the backtrace gets symbolic information, but a wait to contact a network server in order before getting limited information would be annoying. This might have to be an opt-in facility, or at least an opt-out one. |
Good points all around. Other than the env-var based opt-in ($DEBUGINFOD_URLS), libbacktrace or the user could set extra variables to limit time/space of downloads ($DEBUGINFOD_MAXTIME in seconds / _MAXSIZE in bytes). |
For clarification, are |
They are in pre-release elfutils (so will be 0.186 onward, coming by November or so), and will be understood by all debuginfod clients, including the command line front-end. |
(elfutils 0.186 was released a few weeks ago) |
Adding support for debuginfod to libbacktrace can be performed in the following way. First, you extend the Here the This problem can be worked around by performing a dry run of With these changes libbacktrace is able to provide debuginfod information. |
Thanks, but I have a feeling that those approaches will fail badly when libbacktrace is called from a signal handler. |
Not every application of libbacktrace involves signal handlers. |
That is true. But if we add calls out to debuginfod, then those uses of libbacktrace that do use signal handlers seem likely to break. |
Yes. A callback system might be used instead, like in the example I have posted. User of the library might then just return -1, if proper behavior in signal handling is expected (this also conveniently leaves it up to the user to decide if this should be the case). This has the added benefit of offloading the initialization and cleanup of libdebuginfo to the user. |
Around four years ago, libbacktrace learned to handle external (split) debuginfo, whereby it searches various distro standard locations by build-id. If this search is unsuccessful, it would be good to try using the increasingly available debuginfod facility to attempt downloading of a corresponding dwarf file from servers.
For licensing or other reasons, you may not be interested in using the C elfutils debuginfod client library, but you may find spawning the command line tool
debuginfod-find
suitable. https://www.mankier.com/1/debuginfod-findSee also: https://sourceware.org/elfutils/Debuginfod.html .
The text was updated successfully, but these errors were encountered: