Skip to content

Fix #12007 (partially): send RLog via REvent#25414

Open
seifreed wants to merge 1 commit intoradareorg:masterfrom
seifreed:codex/issue-12007-rlog-revent
Open

Fix #12007 (partially): send RLog via REvent#25414
seifreed wants to merge 1 commit intoradareorg:masterfrom
seifreed:codex/issue-12007-rlog-revent

Conversation

@seifreed
Copy link
Contributor

Partially addresses #12007.

This PR integrates RLog with the existing REvent API.

Changes:

  • Add R_EVENT_LOG and an REventLog payload.
  • Add r_log_event() accessor to lazily create a thread-local REvent bus for logging.
  • Emit R_EVENT_LOG from r_log_vmessage() only when the bus exists (no overhead otherwise).
  • Add a unit test that hooks R_EVENT_LOG and validates delivery/unhook.

Partially addresses radareorg#12007.

- Add R_EVENT_LOG and REventLog payload.
- Add r_log_event() accessor to lazily create a thread-local REvent bus for logging.
- Emit R_EVENT_LOG from r_log_vmessage() only when the bus exists (no overhead otherwise).
- Add a unit test that hooks R_EVENT_LOG and validates delivery/unhook.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d3c937d756

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

.line = line,
.msg = out,
};
r_event_send (rlogev, R_EVENT_LOG, &logev);

Choose a reason for hiding this comment

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

P1 Badge Avoid re-entering event lock from log callbacks

When r_log_vmessage emits R_EVENT_LOG, it calls r_event_send directly; r_event_send takes ev->lock (created as non-recursive in r_event_new (false)) and executes callbacks while holding that lock. If a R_EVENT_LOG callback logs again via R_LOG_*, r_log_vmessage re-enters r_event_send on the same bus and blocks on the mutex in pthread builds, so enabling log-event hooks can hang the process in a common callback pattern.

Useful? React with 👍 / 👎.

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.

1 participant