Skip to content

jhsdb does not work with coredump #2579

@YaSuenag

Description

@YaSuenag

I played Truffle NFI on GraalVM, but I cannot get Java stacks from coredump via jhsdb.
I saw DebuggerException on the console:

Error attaching to core file: Can't attach to the core file
sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the core file
        at jdk.hotspot.agent/sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach0(Native Method)
        at jdk.hotspot.agent/sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach(LinuxDebuggerLocal.java:282)
  :

Steps to reproduce the issue

  1. Clone my repository
$ git clone https://github.com/YaSuenag/garakuta.git
  1. Build and install custom language to GraalVM
$ cd truffle-nfi
$ mvn package
$ gu install -L target/truffle-nfi-wrapper-0.1.0-component.jar
  1. Build and run crasher
$ cd truffle-nfi/examples
$ javac MemSetCrash.java
$ java MemSetCrash
  1. Attempt to get Java call stacks via jhsdb
$ jhsdb jstack --exe $GRAALVM_HOME/bin/java --core <coredump>

Describe GraalVM and your environment:

  • GraalVM version: CE 20.1.0
  • JDK major version: 11
  • OS: Fedora 32
  • Architecture: AMD64

More details

I added LIBSAPROC_DEBUG=1 when I ran jhsdb, I saw the debug messages as below.
AFAICS 0x7f1bba69f000 seems to be .svm_heap section.

libsaproc DEBUG: reading library /home/yasuenag/github/graal/sdk/mxbuild/linux-amd64/GRAALVM_CE_JAVA11/graalvm-ce-java11-20.2.0-dev/lib/libjvmcicompiler.so @ 0x7f1bb989c000 [ 0x7f1bb989c000 ]
libsaproc DEBUG: overwrote with new address mapping (memsz 757760 -> 757760)
libsaproc DEBUG: overwrote with new address mapping (memsz 13934592 -> 13934592)
libsaproc DEBUG: address conflict @ 0x7f1bba69f000 (existing map size = 10530816, size = 12942072, flags = 4)
libsaproc DEBUG: can't read shared object's segments

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions