Add tasks.isolate config for optional task core isolation ##core#25273
Add tasks.isolate config for optional task core isolation ##core#25273dnakov wants to merge 1 commit intoradareorg:masterfrom
Conversation
Enable CUSTOMCORE code path with runtime guard via tasks.isolate config (default false). When enabled, tasks get isolated console and block buffer.
PR #25273 Review — "Add tasks.isolate config for optional task core isolation"PR: #25273 Verdict: ❌ Request ChangesThe intent is reasonable — provide optional per-task isolation of the console and block buffer so concurrent tasks don't interfere with each other's output or working data. However, the implementation has multiple high-severity correctness and safety issues that would cause crashes, data corruption, and subtle concurrency bugs if merged. Motivation AnalysisWhat problem is this trying to solve?In radare2's task system (
The PR tries to solve this by optionally giving each task its own Why was CUSTOMCORE=0 before?The Code Path AnalysisHow it works (the intended flow)
What
|
| Aspect | Assessment |
|---|---|
| Motivation | Valid — task output isolation is needed |
| Approach | Risky — shallow memcpy of 1KB+ struct with 50+ shared pointers |
| Console isolation | Broken — r_cons_new() clobbers global singleton |
| Block isolation | Partial — malloc failure silently ignored |
| Subsystem isolation | None — io, anal, flags, config all shared |
| Error handling | Silent fallback hides failures |
| Thread safety | Worse than no isolation — false sense of safety |
The PR's goal is worthwhile, but the implementation needs significant rework. A safer approach might be to:
- Use
r_cons_new2()to avoid the global singleton problem - Only replace
consandblockon the original core (with save/restore) instead of the full memcpy - Or, more ambitiously, implement proper
r_core_clone()that deep-copies the necessary subsystems
Enable CUSTOMCORE code path with runtime guard via tasks.isolate config (default false). When enabled, tasks get isolated console and block buffer.
Description