Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

线程替换集成成功后一直是替换失败的 #481

Open
wanghuasheng opened this issue Feb 18, 2025 · 0 comments
Open

线程替换集成成功后一直是替换失败的 #481

wanghuasheng opened this issue Feb 18, 2025 · 0 comments

Comments

@wanghuasheng
Copy link

集成4.16.3版本
线程替换后,有build日志输出,build文件里也有替换的包。
但是实际监控线程发现根本没有被替换。只是改名而已。
查看替换线程的代码。发现里面的替换逻辑是名字,并不是线程。
// Timer(String)
"(Ljava/lang/String;)V" -> {
method.instructions.apply {
// ..., name => ..., name, prefix
insertBefore(init, LdcInsnNode(makeThreadName(klass.className)))
// ..., name, prefix => ..., name
insertBefore(init, MethodInsnNode(Opcodes.INVOKESTATIC, SHADOW_THREAD, "makeThreadName", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", false))
}
}

执行了以后实际的线程的类在哪里创建的还是在哪里创建,所以在监控平台上看线程数量和线程名,以及线程状态都没有被优化。

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

No branches or pull requests

1 participant