Skip to content
drgn 0.0.21

This release adds lots of new helpers and fixes some important bugs.

New features:

- Helpers for lockless linked lists in the Linux kernel were added: `drgn.helpers.linux.llist`. Contributed by Imran Khan.
- A helper to find the slab cache that a virtual address came from was added: `drgn.helpers.linux.slab.find_containing_slab_cache()`. Contributed by Nhat Pham.
- A `drgn.helpers.common` package was created to contain helpers that can be used with any program (which may have program-specific additional behavior).
- A helper to identify an arbitrary address (e.g., as a symbol or slab object) was added: `drgn.helpers.common.memory.identify_address()`. Contributed by Nhat Pham.
- `PageFoo()` helpers to check various `struct page` flags were added to `drgn.helpers.linux.mm`.
- Helpers for working with compound pages were added to `drgn.helpers.linux.mm`: `compound_head()`, `compound_nr()`, `compound_order()`, and `page_size()`.
- A helper to get the CPU that a task last ran on was added: `drgn.helpers.linux.sched.task_cpu()`.
- Automatic pretty-printing in IPython/Jupyter of `drgn.Object`, `drgn.Type`, `drgn.StackTrace`, and `drgn.StackFrame` was added. Contributed by Shung-Hsi Yu.
- `drgn.StackTrace.prog` was added as a way to get the program that a stack trace came from.

Bug fixes:

- Getting stack traces from a kernel core dump of threads that were running at the time of the crash was fixed for Linux < 4.9 and >= 5.16.
- `drgn.helpers.linux.per_cpu()` and `per_cpu_ptr()` were fixed to work for per-CPU variables defined in kernel modules.
- Reading from pages that were excluded by `makedumpfile` was changed to return zeroes instead of raising a `FaultError`. This is unfortunately necessary because we cannot distinguish between pages that were excluded because their contents were zero and pages that were excluded for other reasons. Contributed by Glen McCready.
- A segfault when looking for a variable in a stack frame caused by strange debug symbols emitted by Clang in certain situations was fixed.
- A reference leak every time a `FaultError` is raised inside of drgn was fixed.
- A use after free when setting an object from a part of itself in libdrgn was fixed. The Python interface is not affected.
- The recommendation for how to get VMCOREINFO in QEMU guest memory dumps was fixed to suggest the correct Linux kernel configuration options.
- A spelling error in a DWARF parsing error message was fixed. Contributed by Michel Alexandre Salim.

API changes:

- `escape_ascii_character()`, `escape_ascii_string()`, `decode_flags()`, and `decode_enum_type_flags()` were moved from `drgn.helpers` to `drgn.helpers.common.format`.
- `enum_type_to_class()` was moved from `drgn.helpers` to `drgn.helpers.common.type`.

Documentation:

- openSUSE installation instructions were added.
- libkdumpfile installation instructions were updated to reflect that it is now packaged on some Linux distributions.
- Python type signatures are now formatted more concisely in the documentation.
- Overloaded helpers are now documented more concisely.
- Various small editorial and formatting issues were fixed.

Other improvements:

- Linux kernel support was tested up to Linux 6.0.
- `drgn.helpers.linux.bpf.cgroup_bpf_prog_for_each()` was updated to work on Linux 6.0.

Internals:

- Some racy stack tracing unit tests were fixed.
- Linux kernel memory management helper unit tests were enabled on AArch64.
- The VM testing setup no longer depends on BusyBox.
- `-Wimplicit-fallthrough` was enabled for builds.
- A syscall number table and normalized machine name were added to `util.py`
  for use in test cases and the VM testing setup.
- Some renaming was done to prepare for the upcoming module API.
- The libdrgn-internal `string_builder` API was improved.