java - 混合模式下的 jstack : WrongTypeException: No suitable match for type of address

标签 java multithreading ubuntu jstack

我正在尝试以混合模式在 ubuntu 上运行 jstack:

 $ jstack -m 7219     

结果是这个异常:

Attaching to process ID 7219, please wait...
Debugger attached successfully.
Server compiler detected.
  JVM version is 25.162-b12
  Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)        
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.tools.jstack.JStack.runJStackTool(JStack.java:140)
    at sun.tools.jstack.JStack.main(JStack.java:106)
 Caused by: java.lang.RuntimeException: Unable to deduce type of thread from address 0x00007f02cc002800 (expected type JavaThread, CompilerThread, ServiceThread, JvmtiAgentThread, or SurrogateLockerThread)
    at sun.jvm.hotspot.runtime.Threads.createJavaThreadWrapper(Threads.java:166)
    at sun.jvm.hotspot.runtime.Threads.first(Threads.java:150)
    at sun.jvm.hotspot.tools.PStack.initJFrameCache(PStack.java:200)
    at sun.jvm.hotspot.tools.PStack.run(PStack.java:71)
    at sun.jvm.hotspot.tools.PStack.run(PStack.java:58)
    at sun.jvm.hotspot.tools.PStack.run(PStack.java:53)
    at sun.jvm.hotspot.tools.JStack.run(JStack.java:66)
    at sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)
    at sun.jvm.hotspot.tools.Tool.start(Tool.java:223)
    at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
    at sun.jvm.hotspot.tools.JStack.main(JStack.java:92)
    ... 6 more
  Caused by: sun.jvm.hotspot.types.WrongTypeException: No suitable match for type of address 0x00007f02cc002800
    at sun.jvm.hotspot.runtime.InstanceConstructor.newWrongTypeException(InstanceConstructor.java:62)
    at sun.jvm.hotspot.runtime.VirtualConstructor.instantiateWrapperFor(VirtualConstructor.java:80)
    at sun.jvm.hotspot.runtime.Threads.createJavaThreadWrapper(Threads.java:162)
    ... 16 more

PID 为 7219 的进程由与 jstack 相同的用户启动。

最佳答案

我在 Ubuntu 上遇到了同样的问题,安装了 openjdk-9-jdk-headless,单独使用 jstack 就可以正常工作,但是 jstack -m 会失败并出现与您相同的错误。

安装 openjdk-9-dbg(带有调试符号的包)解决了这个问题。

关于java - 混合模式下的 jstack : WrongTypeException: No suitable match for type of address,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49516601/

相关文章:

java - 如何在JFrame上绘图

java - 如何实现JDatePicker的FocusListener?

ios - 只能使用-performBlock : on an NSManagedObjectContext that was created with a queue

c++ - 将大小为 4 字节的管道读入 4 字节 int 如何返回更多数据?

mysql 在登录时挂起

mysql - 如何调用远程 MySQL Ubuntu 服务器上的存储过程?

Java 对多个字符串执行相同的操作

Java Date() 给出了错误的日期

java - 顶点 : resource allocation when verticles are idle?

Ubuntu 上的 apache + mod_cluster + wildfly