-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
无法trace 和watch加载skywalking7 的jar中的类方法 #1141
Comments
skywalking 应该是给类增加了 field,导致的问题。skywalking实现机制的问题。 |
该如何解决呢,才能正常使用controller |
@RainElohim 试下这个版本: #1184 |
尝试了一下,还是不可以,报错跟上面楼主的一样,并且用了#1184这里的包之后,执行trace命令后,再执行其他命令会提示Timer already cancelled. 然后无法退出了就,再开个终端用arthas进入同一个进程后执行命令也是这个,不能正常使用了 @hengyunabc 辛苦 |
@RainElohim 具体的 |
arthas错误日志里没有关于这个的,是从arthas控制台打印出来的,就是输入arthas命令后出现的,在我这,按我上面的操作稳定复现,我换了两个进程都是 |
可能和 skywalking 生成的字节码里,用了一些类似lambda的代码有关。 对于下面的controller,skywalking在每次reTransform之后,字节码里的函数名都不一样。 @Controller
public class TestController {
@RequestMapping("/test")
@ResponseBody
public String test() {
return "test";
}
} 第一次jad结果:
第二次: @Controller
public class TestController
implements EnhancedInstance,
EnhancedInstance {
private volatile Object _$EnhancedClassField_ws;
public static volatile /* synthetic */ InstMethodsInter delegate$dnkuls0;
public static volatile /* synthetic */ InstMethodsInter delegate$4sa87m1;
public static volatile /* synthetic */ ConstructorInter delegate$qe910b1;
private static final /* synthetic */ Method cachedValue$0cEL6pOE$lt7gtc1;
public static volatile /* synthetic */ InstMethodsInter delegate$8mqi1i0;
public static volatile /* synthetic */ InstMethodsInter delegate$igef700;
public static volatile /* synthetic */ ConstructorInter delegate$hqtp9d0;
private static final /* synthetic */ Method cachedValue$6iYRJM1N$lt7gtc1;
public TestController() {
this(null);
delegate$hqtp9d0.intercept((Object)this, new Object[0]);
}
private /* synthetic */ TestController(auxiliary.YL8stOUn yL8stOUn) {
}
@RequestMapping(value={"/test"})
@ResponseBody
public String test() {
return (String)delegate$igef700.intercept((Object)this, new Object[0], (Callable)new auxiliary.5212MTs4(this), cachedValue$6iYRJM1N$lt7gtc1);
}
private /* synthetic */ String test$original$FiEFBU6M() {
return "test";
}
static {
ClassLoader.getSystemClassLoader().loadClass("org.apache.skywalking.apm.dependencies.net.bytebuddy.dynamic.Nexus").getMethod("initialize", Class.class, Integer.TYPE).invoke(null, TestController.class, -1004178659);
cachedValue$6iYRJM1N$lt7gtc1 = TestController.class.getMethod("test", new Class[0]);
}
final /* synthetic */ String test$original$FiEFBU6M$accessor$6iYRJM1N() {
return this.test$original$FiEFBU6M();
}
} 可以看到,
|
我的jdk是: 但是还出现这个问题,那么有没有什么更具体的解决方案 |
@RainElohim 我觉得这个是 skywalking的实现的问题。我测试用 btrace也无办法正常工作。测试脚本: import org.openjdk.btrace.core.annotations.BTrace;
import org.openjdk.btrace.core.annotations.Injected;
import org.openjdk.btrace.core.annotations.OnMethod;
import org.openjdk.btrace.core.annotations.ProbeClassName;
import org.openjdk.btrace.core.annotations.ProbeMethodName;
import org.openjdk.btrace.core.annotations.Self;
import org.openjdk.btrace.core.annotations.ServiceType;
import org.openjdk.btrace.services.impl.Printer;
@BTrace
public class AllMethods {
@Injected(ServiceType.RUNTIME)
private static Printer printer;
@OnMethod(
clazz = "com.example.demo.TestController",
method = "test"
)
public static void m(@Self Object o, @ProbeClassName String probeClass, @ProbeMethodName String probeMethod) {
printer.println("this = " + o);
printer.print("entered " + probeClass);
printer.println("." + probeMethod);
}
} 不清楚为什么 skywalking 的实现里每次函数名都变化。 |
@RainElohim 另外,每执行一次 jad,即触发一次 执行多次jad之后,用sc命令可以查找到。
|
感谢解答,辛苦了。我去skywalking下面提问下,看看有没有解决办法,apache/skywalking#4820 |
那边说是arthas运行时的问题。。。具体看apache/skywalking#4820 |
和arthas无关,提供一个中文 only 的demo: https://github.com/hengyunabc/skywalking-error-demo |
raphw/byte-buddy#829 参考这篇 |
提交了一个PR,增加ByteBuddy class cache特性,解决retransform失败的问题。 https://github.com/hengyunabc/skywalking-error-demo 这个原型验证通过,可以使用Arthas注入并执行trace命令。
|
SkyWalking: Compatible with other javaagent bytecode processing |
中文Only,干的漂亮! |
你好,我正好也遇到这个问题了,trace失败,skywalking agent版本是8.11,看skywalking.jar中java版本是1.8.0_312,服务器上java 版本是1.8.0_292,这个可能是什么问题呢 |
最终怎么解决的,我也遇到了同样问题,项目中同时使用了skywalking和arthas |
环境信息
arthas-boot.jar
或者as.sh
的版本: 3.2.0arthas-boot
的版本: 3.2重现问题的步骤
trace 类方法报错
期望的结果
What do you expected from the above steps?
展示调用栈及耗时
实际运行的结果
实际运行结果,最好有详细的日志,异常栈。尽量贴文本。
Error during processing the command: null
class类被skywalking做了增强.
jad class结果:
@RestController
public class ItemController
implements ItemApi,
EnhancedInstance,
EnhancedInstance {
@Autowired
private IHolidayItemFacade holidayItemFacade;
private volatile Object _$EnhancedClassField_ws;
public static volatile /* synthetic / InstMethodsInter delegate$7gn76d1;
public static volatile / synthetic / InstMethodsInter delegate$lv6d7p1;
public static volatile / synthetic / ConstructorInter delegate$27t3dk1;
private static final / synthetic / Method cachedValue$BGsZ60W7$h0kumm0;
private static final / synthetic / Method cachedValue$BGsZ60W7$mheqqj2;
private static final / synthetic / Method cachedValue$BGsZ60W7$7b1jhl2;
private static final / synthetic / Method cachedValue$BGsZ60W7$h90el41;
private static final / synthetic / Method cachedValue$BGsZ60W7$o2lomh2;
private static final / synthetic / Method cachedValue$BGsZ60W7$2cp92d3;
private static final / synthetic / Method cachedValue$BGsZ60W7$trthg52;
private static final / synthetic / Method cachedValue$BGsZ60W7$etp7162;
private static final / synthetic / Method cachedValue$BGsZ60W7$20eg8u0;
private static final / synthetic / Method cachedValue$BGsZ60W7$5ftnfq2;
private static final / synthetic / Method cachedValue$BGsZ60W7$pg6p5u1;
private static final / synthetic / Method cachedValue$BGsZ60W7$p6onuj0;
private static final / synthetic / Method cachedValue$BGsZ60W7$avq2ph1;
private static final / synthetic / Method cachedValue$BGsZ60W7$qkdlei1;
private static final / synthetic / Method cachedValue$BGsZ60W7$jb5tsd2;
private static final / synthetic / Method cachedValue$BGsZ60W7$5tcatp1;
private static final / synthetic / Method cachedValue$BGsZ60W7$nird923;
private static final / synthetic / Method cachedValue$BGsZ60W7$n3hau21;
private static final / synthetic / Method cachedValue$BGsZ60W7$hu9rep3;
private static final / synthetic / Method cachedValue$BGsZ60W7$kootqq0;
private static final / synthetic / Method cachedValue$BGsZ60W7$png6703;
private static final / synthetic / Method cachedValue$BGsZ60W7$ijv26b1;
private static final / synthetic / Method cachedValue$BGsZ60W7$trbqar3;
private static final / synthetic / Method cachedValue$BGsZ60W7$j92umg1;
private static final / synthetic / Method cachedValue$BGsZ60W7$itutci2;
private static final / synthetic / Method cachedValue$BGsZ60W7$r72ggd2;
public static volatile / synthetic / InstMethodsInter delegate$8v6lb91;
public static volatile / synthetic / InstMethodsInter delegate$a9tapa0;
public static volatile / synthetic / ConstructorInter delegate$i1erl51;
private static final / synthetic / Method cachedValue$v34oxCGE$h0kumm0;
private static final / synthetic / Method cachedValue$v34oxCGE$mheqqj2;
private static final / synthetic / Method cachedValue$v34oxCGE$7b1jhl2;
private static final / synthetic / Method cachedValue$v34oxCGE$h90el41;
private static final / synthetic / Method cachedValue$v34oxCGE$o2lomh2;
private static final / synthetic / Method cachedValue$v34oxCGE$2cp92d3;
private static final / synthetic / Method cachedValue$v34oxCGE$trthg52;
private static final / synthetic / Method cachedValue$v34oxCGE$etp7162;
private static final / synthetic / Method cachedValue$v34oxCGE$20eg8u0;
private static final / synthetic / Method cachedValue$v34oxCGE$5ftnfq2;
private static final / synthetic / Method cachedValue$v34oxCGE$pg6p5u1;
private static final / synthetic / Method cachedValue$v34oxCGE$p6onuj0;
private static final / synthetic / Method cachedValue$v34oxCGE$avq2ph1;
private static final / synthetic / Method cachedValue$v34oxCGE$qkdlei1;
private static final / synthetic / Method cachedValue$v34oxCGE$jb5tsd2;
private static final / synthetic / Method cachedValue$v34oxCGE$5tcatp1;
private static final / synthetic / Method cachedValue$v34oxCGE$nird923;
private static final / synthetic / Method cachedValue$v34oxCGE$n3hau21;
private static final / synthetic / Method cachedValue$v34oxCGE$hu9rep3;
private static final / synthetic / Method cachedValue$v34oxCGE$kootqq0;
private static final / synthetic / Method cachedValue$v34oxCGE$png6703;
private static final / synthetic / Method cachedValue$v34oxCGE$ijv26b1;
private static final / synthetic / Method cachedValue$v34oxCGE$trbqar3;
private static final / synthetic / Method cachedValue$v34oxCGE$j92umg1;
private static final / synthetic / Method cachedValue$v34oxCGE$itutci2;
private static final / synthetic */ Method cachedValue$v34oxCGE$r72ggd2;
}
The text was updated successfully, but these errors were encountered: