Fix #12007 (partially): send RLog via REvent#25414
Fix #12007 (partially): send RLog via REvent#25414seifreed wants to merge 1 commit intoradareorg:masterfrom
Conversation
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.
There was a problem hiding this comment.
💡 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); |
There was a problem hiding this comment.
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 👍 / 👎.
Partially addresses #12007.
This PR integrates RLog with the existing REvent API.
Changes: