[fix] 停止 Incision 修改 attach self 全局属性 - #727
Merged
Bkm016 merged 1 commit intoAug 8, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
ManualSelfAttach运行时写入jdk.attach.allowAttachSelf=true,但 HotSpot 的 self-attach 权限读取启动快照,运行时写入不能真正开启 attach;ByteBuddy 等库却读取实时属性,导致后续插件误判为可进程内 attach,跳过外部 helper,影响 Iris 等 agent 用户。修改
ManualSelfAttach对jdk.attach.allowAttachSelf的运行时写入。-Djdk.attach.allowAttachSelf=true配置。GetEnv、ClassFileLoadHook或RetransformClasses。module/incision/TECHNICAL.md,记录 HotSpot 启动快照与 ByteBuddy 实时属性的差异。设计取舍
没有采用“失败后恢复属性”:并发插件仍可能在恢复前读取到错误值,而且无法区分用户或其他插件原本设置的值。Incision 不应修改这个进程级共享开关。
验证
git diff --check通过。javap验证HotSpotVirtualMachine使用VM.getSavedProperty初始化ALLOW_ATTACH_SELF。Closes #726