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

本机调试运行LocalDebugTest时 VirtualMachine.attach 失败 求解。 #196

Closed
binbin0325 opened this issue Oct 9, 2018 · 7 comments

Comments

@binbin0325
Copy link

binbin0325 commented Oct 9, 2018

VirtualMachine.attach 失败 发现 AttachProvider.providers() 返回的list size=0

pid:244676

[Ljava.lang.String;@42b61c8f244676Start arthas failed, exception stack trace: 
Disconnected from the target VM, address: '127.0.0.1:50732', transport: 'socket'
java.lang.NullPointerException
	at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:182)
	at com.taobao.arthas.core.Arthas.attachAgent(Arthas.java:68)
	at com.taobao.arthas.core.Arthas.<init>(Arthas.java:26)
	at com.taobao.arthas.core.Arthas.main(Arthas.java:98)
	at LocalDebugTest$1.run(LocalDebugTest.java:33)
	at java.lang.Thread.run(Thread.java:748)

Process finished with exit code -1
@Hearen
Copy link
Contributor

Hearen commented Oct 10, 2018

Encountered the same issue and details are:

Environment

  • Arthas version: 3.0.4
  • Operating System version: 16.04.1-Ubuntu 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Java version of target JVM: jdk1.8.0_144
  • Java version of JVM used to attach: jdk1.8.0_144

Steps to reproduce this issue

  1. Just run the **/arthas/core/src/test/java/LocalDebugTest.java in debug mode;

Expected Result

Arthas server started and print out:

代码植入成功

Actual Result

Error as:

/opt/jdk1.8.0_144/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:44829,suspend=y,server=n -Dvisualvm.id=78064397008490 -Dfile.encoding=UTF-8 -classpath /opt/jdk1.8.0_144/jre/lib/charsets.jar:/opt/jdk1.8.0_144/jre/lib/deploy.jar:/opt/jdk1.8.0_144/jre/lib/ext/cldrdata.jar:/opt/jdk1.8.0_144/jre/lib/ext/dnsns.jar:/opt/jdk1.8.0_144/jre/lib/ext/jaccess.jar:/opt/jdk1.8.0_144/jre/lib/ext/jfxrt.jar:/opt/jdk1.8.0_144/jre/lib/ext/localedata.jar:/opt/jdk1.8.0_144/jre/lib/ext/nashorn.jar:/opt/jdk1.8.0_144/jre/lib/ext/sunec.jar:/opt/jdk1.8.0_144/jre/lib/ext/sunjce_provider.jar:/opt/jdk1.8.0_144/jre/lib/ext/sunpkcs11.jar:/opt/jdk1.8.0_144/jre/lib/ext/zipfs.jar:/opt/jdk1.8.0_144/jre/lib/javaws.jar:/opt/jdk1.8.0_144/jre/lib/jce.jar:/opt/jdk1.8.0_144/jre/lib/jfr.jar:/opt/jdk1.8.0_144/jre/lib/jfxswt.jar:/opt/jdk1.8.0_144/jre/lib/jsse.jar:/opt/jdk1.8.0_144/jre/lib/management-agent.jar:/opt/jdk1.8.0_144/jre/lib/plugin.jar:/opt/jdk1.8.0_144/jre/lib/resources.jar:/opt/jdk1.8.0_144/jre/lib/rt.jar:/home/hearen/git/personal/arthas/core/target/test-classes:/home/hearen/git/personal/arthas/core/target/classes:/home/hearen/.m2/repository/org/ow2/asm/asm/6.0/asm-6.0.jar:/home/hearen/.m2/repository/org/ow2/asm/asm-commons/6.0/asm-commons-6.0.jar:/home/hearen/.m2/repository/org/ow2/asm/asm-tree/6.0/asm-tree-6.0.jar:/home/hearen/.m2/repository/com/alibaba/middleware/termd-core/1.1.5/termd-core-1.1.5.jar:/home/hearen/.m2/repository/io/netty/netty-common/4.1.29.Final/netty-common-4.1.29.Final.jar:/home/hearen/.m2/repository/io/netty/netty-buffer/4.1.29.Final/netty-buffer-4.1.29.Final.jar:/home/hearen/.m2/repository/io/netty/netty-transport/4.1.29.Final/netty-transport-4.1.29.Final.jar:/home/hearen/.m2/repository/io/netty/netty-resolver/4.1.29.Final/netty-resolver-4.1.29.Final.jar:/home/hearen/.m2/repository/io/netty/netty-handler/4.1.29.Final/netty-handler-4.1.29.Final.jar:/home/hearen/.m2/repository/io/netty/netty-codec/4.1.29.Final/netty-codec-4.1.29.Final.jar:/home/hearen/.m2/repository/io/netty/netty-codec-http/4.1.29.Final/netty-codec-http-4.1.29.Final.jar:/home/hearen/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.7.4/jackson-core-2.7.4.jar:/home/hearen/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.7.4/jackson-databind-2.7.4.jar:/home/hearen/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.7.0/jackson-annotations-2.7.0.jar:/home/hearen/.m2/repository/com/alibaba/middleware/cli/1.0.1/cli-1.0.1.jar:/home/hearen/.m2/repository/com/taobao/text/text-ui/0.0.2/text-ui-0.0.2.jar:/home/hearen/.m2/repository/com/fifesoft/rsyntaxtextarea/2.5.8/rsyntaxtextarea-2.5.8.jar:/home/hearen/.m2/repository/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar:/home/hearen/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar:/home/hearen/.m2/repository/ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.jar:/home/hearen/.m2/repository/com/taobao/middleware/logger.api/0.2.6/logger.api-0.2.6.jar:/home/hearen/.m2/repository/com/taobao/middleware/logger.core/0.2.6/logger.core-0.2.6.jar:/home/hearen/.m2/repository/com/taobao/middleware/logger.pandolet/0.2.6/logger.pandolet-0.2.6.jar:/home/hearen/.m2/repository/com/alibaba/fastjson/1.2.33/fastjson-1.2.33.jar:/home/hearen/.m2/repository/ognl/ognl/3.1.12/ognl-3.1.12.jar:/home/hearen/.m2/repository/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA.jar:/home/hearen/.m2/repository/junit/junit/4.11/junit-4.11.jar:/home/hearen/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/home/hearen/.m2/repository/org/benf/cfr/0.132/cfr-0.132.jar:/home/hearen/.m2/repository/org/powermock/powermock-module-javaagent/1.7.4/powermock-module-javaagent-1.7.4.jar:/home/hearen/.m2/repository/org/powermock/powermock-core/1.7.4/powermock-core-1.7.4.jar:/home/hearen/.m2/repository/org/powermock/powermock-reflect/1.7.4/powermock-reflect-1.7.4.jar:/home/hearen/.m2/repository/org/objenesis/objenesis/2.4/objenesis-2.4.jar:/home/hearen/.m2/repository/org/mockito/mockito-core/2.8.9/mockito-core-2.8.9.jar:/home/hearen/.m2/repository/net/bytebuddy/byte-buddy/1.6.14/byte-buddy-1.6.14.jar:/home/hearen/.m2/repository/net/bytebuddy/byte-buddy-agent/1.6.14/byte-buddy-agent-1.6.14.jar:/home/hearen/Downloads/idea-IU-172.4343.14/lib/idea_rt.jar LocalDebugTest
Connected to the target VM, address: '127.0.0.1:44829', transport: 'socket'
pid:32218
Start arthas failed, exception stack trace: 
java.lang.NullPointerException
	at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:182)
	at com.taobao.arthas.core.Arthas.attachAgent(Arthas.java:67)
	at com.taobao.arthas.core.Arthas.<init>(Arthas.java:25)Disconnected from the target VM, address: '127.0.0.1:44829', transport: 'socket'

	at com.taobao.arthas.core.Arthas.main(Arthas.java:96)
	at LocalDebugTest$1.run(LocalDebugTest.java:32)
	at java.lang.Thread.run(Thread.java:748)

Process finished with exit code 255

As @sanxun0325 pointed out the AttachProvider.providers(); returns an empty list.

F.Y.I

  1. VirtualMachine lies here: ~/.m2/repository/org/powermock/powermock-module-javaagent/1.7.4/powermock-module-javaagent-1.7.4.jar!/com/sun/tools/attach/VirtualMachine.class
  2. tried mvn clean compile in **/arthas/core but still no luck there.

@ralf0131 @hengyunabc

@hengyunabc
Copy link
Collaborator

Please refer to https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md , I will remove LocalDebugTest.

@hengyunabc
Copy link
Collaborator

如果 https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md 里有说明不清楚的地方,我再补充说明下。

@Hearen
Copy link
Contributor

Hearen commented Oct 10, 2018

如果 https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md 里有说明不清楚的地方,我再补充说明下。

@hengyunabc I started this issue too: #203 even after checking the details in the doc.

It would be great if you could elaborate the doc as you mentioned.

@binbin0325
Copy link
Author

@hengyunabc 对于在idea中调试程序,希望能详细说明下步骤。因为执行LocalDebugTest 一直attach 失败,返回null。

@Hearen
Copy link
Contributor

Hearen commented Oct 11, 2018

@ralf0131 cc @hengyunabc It's NOT just about LocalDebugTest

... I will remove LocalDebugTest.

It's that I could NOT debug Arthas in IntelliJ. Please take a look at #203 and also the current issue #204 #196

@hengyunabc
Copy link
Collaborator

@Hearen @sanxun0325 #222

lzc-alioo pushed a commit to lzc-alioo/arthas that referenced this issue May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants