-
Notifications
You must be signed in to change notification settings - Fork 8
Debug Tooling #78
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
base: main
Are you sure you want to change the base?
Debug Tooling #78
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,7 +175,21 @@ RUN mkdir -p /symbols && \ | |
| ln -s /opt/fuzzer/bin/rippled-fuzzer /symbols/rippled-fuzzer | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| RUN set -ex; apt-get update && apt-get install --yes curl jq procps gdb iproute2 && rm -rf /var/lib/apt/lists/* | ||
| # gdb opens a core / attaches to a live process to produce a symbolized backtrace | ||
| # in MVD; binutils supplies objcopy (used by gdb-add-index below) plus objdump/ | ||
| # readelf as gdb companions. The xrpld binary ships full DWARF + symtab (unstripped | ||
| # Debug build), so no separate symbol package is needed. | ||
| RUN set -ex; apt-get update && apt-get install --yes curl jq procps gdb binutils iproute2 && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Embed a .gdb_index in the binaries (gdb-add-index ships with gdb; it uses objcopy | ||
| # from binutils). Without it, gdb rebuilds its symbol table by scanning ~600 MB of | ||
| # DWARF at startup -- significant CPU and memory that, on a resource-constrained MVD | ||
| # VM, can overrun the debug-session command window; the index lets gdb jump straight | ||
| # to the units it needs. One-time build cost (the scan happens here); the /symbols/* | ||
| # links resolve to these same files. | ||
| RUN set -ex; \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This Doing the indexing in an intermediate stage keeps one copy in the final image. |
||
| gdb-add-index /opt/xrpld/bin/xrpld; \ | ||
| gdb-add-index /opt/fuzzer/bin/rippled-fuzzer | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
maybe worth adding additional checks here? (If you switch to |
||
|
|
||
| # Create fuzzer config directory and xrpld directories | ||
| RUN mkdir -p /etc/fuzzer /var/lib/xrpld/db /var/log/xrpld | ||
|
|
||
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.
The PR description says this "(should)" fix the timeouts — since the whole change is a performance one, worth landing a measured number in the comment rather than "minutes → seconds":
Also: clang 22 defaults to DWARF 5, and
gdb-add-index --dwarf-5emits the native.debug_namesaccelerator instead of.gdb_index. On DWARF-5 input that's often the faster of the two, so it seems worth A/B-ing before settling on the default.