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

Handle truncated pr_fname #484

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brenns10
Copy link
Contributor

@brenns10 brenns10 commented Mar 18, 2025

It appears that some core dumps may have a "pr_fname" which isn't nul-terminated, which leads to the following exception, even if you're not interested in the thread name:

>>> next(prog.threads()).stack_trace()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
Exception: pr_fname is not null terminated

Handle this by creating a copy and nul-terminating it.

Closes: #483
Fixes: e6cc9b0 ("Add name to drgn.Thread")

@brenns10 brenns10 force-pushed the fix_truncated_fname branch 2 times, most recently from 03c7671 to ea677ec Compare March 18, 2025 00:05
@brenns10
Copy link
Contributor Author

It wouldn't be a PR from me if I didn't force-push it 3 times in rapid succession 😭 sorry lol

@brenns10 brenns10 force-pushed the fix_truncated_fname branch from ea677ec to 0723df9 Compare March 18, 2025 00:11
It appears that some core dumps may have a "pr_fname" which isn't
nul-terminated, which leads to the following exception, even if you're
not interested in the thread name:

>>> next(prog.threads()).stack_trace()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
Exception: pr_fname is not null terminated

Handle this by creating a copy and nul-terminating it.

Closes: osandov#483
Fixes: e6cc9b0 ("Add name to drgn.Thread")

Signed-off-by: Stephen Brennan <[email protected]>
@brenns10 brenns10 force-pushed the fix_truncated_fname branch from 0723df9 to 9240cae Compare March 18, 2025 00:20
@brenns10
Copy link
Contributor Author

Sorry for all that noise. Realizing I really need to code-review myself before sending the PR. It's funny, the Github UI is apparently much easier for my to review my own code in, rather than the editor/git log.

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.

Fix handling of userspace core dumps with truncated pr_fname
1 participant