一句话:DIBE 在并发执行下安全地对运行中的 x86-64 程序进行多站点二进制修补,常见情况下无需陷入线程。
对运行中的 x86-64 进程做二进制插桩很难:变长指令与弱对齐使并发下的就地修改不安全。已有运行时方案要么每次覆盖都陷入线程,要么全局同步,扩展性受限。本文提出 DIBE:管理进程决定多站点修补策略与 trampoline 放置并导出元数据;目标进程内轻量运行时按保持中间状态正确的顺序重放编辑,安全地在活进程上激活 E9Patch 多站点重写。它用硬件原子原语完成 77–90% 覆盖,跨边界才回退 trap。在 28 个 SPEC CPU2006 基准和多进程 Nginx 上,插桩覆盖接近静态 E9Patch,几何平均执行开销差在 0.5% 内,单指令覆盖延迟低于微秒,持续负载下零 trap。
Applying binary instrumentation to a running x86-64 process is difficult because variable-length instructions and weak alignment guarantees prevent safe in-place code modification under concurrent execution. Existing run-time approaches either trap concurrent threads on every overwrite or require global synchronization, limiting scalability. This paper presents DIBE, a run-time binary editing framework that safely instruments running x86-64 programs without trapping in the common case. An admin process resolves all instrumentation decisions, including multi-site patching tactics and trampoline placement, and exports them as metadata. A lightweight runtime inside the target process replays these edits, safely activating E9Patch's multi-site rewriting tactics on the live process by applying their dependent overwrites in an order that keeps every intermediate program state correct under concurrent execution, a guarantee that single-site punning and offline rewriting do not provide. It applies 77-90% of overwrites using hardware atomic primitives invisible to concurrent threads, with a trap-based fallback only for the remaining cross-boundary cases. We evaluate DIBE on 28 SPEC CPU2006 benchmarks and a multi-process Nginx server, and demonstrate it at browser scale on a running Chrome renderer and as a live memory-safety checker. DIBE matches static E9Patch on both instrumentation coverage (near-complete) and execution time overhead (within 0.5% at the geometric mean), keeps per-instruction overwrite latency sub-microsecond, and records zero trap hits across all Nginx configurations under sustained load.