Skip to content

Improve libelf diagnostics, fix bugs and typos#3278

Closed
systems-assistant[bot] wants to merge 1 commit into
developfrom
import/develop/ROCm_rocr_debug_agent/pr-27
Closed

Improve libelf diagnostics, fix bugs and typos#3278
systems-assistant[bot] wants to merge 1 commit into
developfrom
import/develop/ROCm_rocr_debug_agent/pr-27

Conversation

@systems-assistant

Copy link
Copy Markdown
Contributor

Add elf_errmsg () to elf_begin (), elf_getphdrnum (), gelf_getphdr () failure messages so libelf error reasons are visible.

In process_dbgapi_events (), switch on one_bit instead of stop_reason to correctly handle single bit stop-reasons.

In log (), use vsnprintf with size+1 buffer and resize to avoid buffer overrun; replace vsprintf.

In code_object_t::open (), add a bounds check when %-decoding the URI to avoid an out-of-bounds memory access.

Check elf_strptr () for null before constructing a std::string.

Fix typos.

Change-Id: I71ea1641d21190d5c2d8525e9aaf3837cc35057b


🔁 Imported from ROCm/rocr_debug_agent#27
🧑‍💻 Originally authored by @ammallya

@lancesix lancesix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

Add elf_errmsg () to elf_begin (), elf_getphdrnum (), gelf_getphdr ()
failure messages so libelf error reasons are visible.

In process_dbgapi_events (), switch on one_bit instead of stop_reason
to correctly handle single bit stop-reasons.

In log (), use vsnprintf with size+1 buffer and resize to avoid
buffer overrun; replace vsprintf.

In code_object_t::open (), add a bounds check when %-decoding the URI
to avoid an out-of-bounds memory access.

Check elf_strptr () for null before constructing a std::string.

Fix typos.

Change-Id: I71ea1641d21190d5c2d8525e9aaf3837cc35057b
@lancesix lancesix force-pushed the import/develop/ROCm_rocr_debug_agent/pr-27 branch from b7b3a51 to 8871ee8 Compare February 23, 2026 22:21
@lumachad

lumachad commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

@lancesix Should this one be picked up again?

Edit: It isn't clear who the original author was.
Edit2: I see now it was @lmoriche

@lancesix

Copy link
Copy Markdown
Contributor

Yes, we probably still want this. I'll take a TODO to handle the conflict now reported.

@lumachad lumachad marked this pull request as draft May 5, 2026 10:39
@lumachad

lumachad commented May 5, 2026

Copy link
Copy Markdown
Contributor

Downgraded to draft. Once it's ready we can flip it back.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been inactive for 25 days and will be marked as stale.

If you would like to keep this PR open, please:

  • Add new commits
  • Add a comment explaining why it should remain open

This PR will be automatically closed in 5 days if no further activity occurs.

@github-actions github-actions Bot added the Stale PR has no activity for 25+ days label May 31, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed due to inactivity (30 days with no updates).

If you'd like to continue working on this, feel free to reopen the PR or create a new one.

@github-actions github-actions Bot closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants