Repository navigation
This release hardens drgn against untrusted debugging information and core dumps and adds a few features.
New features:
- QEMU guest debugging has been optimized to read memory directly from the QEMU process when possible.
irq_get_nr_irqs()was added todrgn.helpers.linux.irq. It gets the number of IRQs on the system.task_group_sched_entity()was added todrgn.helpers.linux.sched. It gets the scheduler entity of a task group on a given CPU.- s390x and ppc64 dumps without virtual memory segments are now supported. Contributed by Jimmy Brisson.
- The crash
bpfcommand now supports the-soption for displaying BPF map or program structures, along with the-xand-doptions for controlling its formatting. Contributed by Suchit Karunakaran. - A partial implementation of the crash
netcommand was added. Contributed by Praveen Kumar Kannoju. - The LoongArch64 architecture is now recognized. Contributed by George Guo.
- Linux 7.2 is now supported.
- The crash
irqcommand was updated to handle thenr_irqsglobal variable being renamed. - A test case was updated to handle the removal of
struct task_group::se.
- The crash
- Linux 7.3 is now supported.
drgn.helpers.linux.fs.path_lookup()was updated to handle changes to the root filesystem of the initial mount namespace.tools/fsrefs.pywas updated to handle changes tobinfmt_misc.drgn.helpers.linux.sched.cfs_rq_for_each_entity()was updated to handle changes to task groups.
Other improvements:
drgn.Program.main_thread()anddrgn.Program.crashed_thread()now raiseLookupErrorinstead ofExceptionif the thread is not found.- Operations that cannot be supported on a given program or object now raise a new exception type,
drgn.UnsupportedOperation, instead ofValueError.drgn.UnsupportedOperationinherits fromValueError, so existing code that catches the latter should not break. - Iterating over a module iterator or module section iterator after the underlying set of modules/sections has been modified now raises
RuntimeErrorinstead ofException. - Most operations that encounter malformed data (DWARF, ELF, etc.) now raise a new exception type,
drgn.BadDataError, instead ofException. - Address ranges for loaded userspace modules are now page-aligned, and a module whose segments are not contiguous now has multiple address ranges. Note that this may require the use of
drgn.Module.address_rangesinstead ofdrgn.Module.address_range.
Bug fixes:
- Address translation in a userspace context was fixed for core dumps without virtual memory segments. Contributed by Jimmy Brisson.
- Float-to-integer conversions on
drgn.Objectare now always defined. - A null pointer dereference when calling
stack_trace()with an object with anonymous type was fixed. - A missing space in a
set_enabled_*_finders()error message was fixed. - A memory leak in an error path in
drgn.Program.enum_type()was fixed. - AArch64 PAC mask handling from userspace core dumps of a different byte order than the host was fixed.
- The
ccrregister on ppc64 is now read correctly from core dumps and the Linux kernel. - An infinite loop in
drgn.StackFrame.locals()when aDW_TAG_enumeratorDIE doesn't have aDW_AT_namewas fixed. - Kallsyms parsing was fixed to consistently determine the length of names. Contributed by Stephen Brennan.
- Python symbol finders were fixed to not truncate addresses to 32 bits on 32-bit hosts and to initialize the symbol lifetime.
- A misleading debug log message in
drgn.Program.load_module_debug_info()for modules whose debugging information is not wanted was fixed. - Getting an incomplete member of a value object was fixed to return an absent object instead of erroring.
drgn.Object.format_(implicit_members=False)anddrgn.Object.value_()were fixed for objects with incomplete members.drgn.Program.set_linux_kernel_custom()was fixed to reject a program with existing virtual memory segments.drgn.Program.set_qemu_qmp()was fixed to not reset an already-initialized program.- A bug in ORC unwinder sorting and lookups was fixed.
- DWARF indexing was fixed to correctly handle long stretches of attributes that it skips.
NT_PRPSINFOandNT_PRSTATUSnote lookups were fixed to only match notes with the exact name "CORE", not a prefix of that.- Formatting of functions that return a pointer to a function or array was fixed.
- A case where a module address range overlap was missed is now caught.
- Parsing of a-f hexadecimal digits, the 0X prefix, and invalid octals in
drgn.Program.type()anddrgn.offsetof()was fixed. - Types from DWARF with a byte size >= 2^31 are now handled correctly.
- C++ type lookups with an identifier that is followed by something other than template arguments were fixed.
- Handling of GNU-compressed
.zdebug_strsections was fixed. - A couple of cases where the address mask wasn't applied when evaluating a DWARF expression were fixed.
- The helper that the drgn CLI uses to open
/proc/kcoreviasudonow runs Python in isolated mode so that standard library modules can't be shadowed. key in progandkey in stack_framenow returnFalsefor a key that is not a string instead of raising an exception.- A crash when calling
drgn.Program.__contains__()ordrgn.StackFrame.__contains__()directly instead of using theinoperator was fixed. - An address range overlap error when the segments of two userspace modules are interleaved (e.g., on AArch64 when the vDSO is mapped in a gap between the program interpreter's segments) was fixed. Contributed by Stephen Brennan.
- Many memory safety bugs (buffer overflow, out-of-bounds access, null pointer dereference, use-after-free, double-free, uninitialized memory read), undefined behavior bugs (integer overflow, invalid arithmetic operations), and memory leaks were fixed. Some can be triggered by crafted inputs. Others require a user running pathological code.
- Many missing error checks were fixed.
- Excessive recursion in various operations caused by deeply nested or cyclic types or namespaces is now limited.
- A double file descriptor close when loading kernel module section information was fixed.
- Build errors with GCC 16, glibc 2.43, and C23 were fixed.
- On 32-bit builds, drgn now uses at most 8 threads by default to avoid running out of virtual address space on machines with many CPUs.
Documentation:
- Exception documentation was made more concise.
contrib directory:
- Several improvements were made to
contrib/pstack.py, and itsdumpanddump-printmodes were removed. Contributed by Stephen Brennan.
Internal:
- Documentation for how to add support for new architectures was updated. Contributed by Charlie Jenkins.
- Tests that require a kernel module that isn't available are now skipped. Contributed by Alexandra Hájková.