Skip to content
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

contrib: ptdrgn: fix FaultError when displaying objects #439

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

brenns10
Copy link
Contributor

See the commit message for the situation and justification. This is just a quick fix for the ptdrgn script (which I use constantly). But I did end up comparing against the built-in drgn CLI and noticed that the behavior on the example quoted in the commit is a bit confusing too, so I'll create a separate issue on that.

Some objects (e.g. percpu variables) cannot be displayed because their
memory location is wrong, and displaying them would result in a fault
error. In the ptdrgn script, any expression resulting in such an object
will crash the entire REPL. For example:

>>> prog["cpuhp_state"]
Traceback (most recent call last):
[ ... ]
_drgn.FaultError: could not read memory from kdump: Cannot get page I/O address: PDPT table not present: p4d[0] = 0x0: 0x202a0

Handle these by simply displaying the repr() of the object:

>>> prog["cpuhp_state"]
Object(prog, 'struct cpuhp_cpu_state', address=0x202a0)
>>>

Signed-off-by: Stephen Brennan <[email protected]>
@osandov osandov merged commit 735b9e8 into osandov:main Oct 10, 2024
21 of 39 checks passed
@brenns10 brenns10 deleted the ptdrgn_fault branch October 10, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants