Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7093659

JNI FindClass Crashes VM ( same as 4343727)

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      FULL PRODUCT VERSION :
      java version "1.7.0"
      Java(TM) SE Runtime Environment (build 1.7.0-b147)
      Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

      FULL OS VERSION :
      Linux ginger-fred 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:07:13 UTC 2011 x86_64 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Compiling in C++ mode with gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3

      A DESCRIPTION OF THE PROBLEM :
        Toying with HeapTracker demo. After some modifications VM crashes when FindClass is called in cbVMStart.

      I have implemented a java class com.test.HeapTracker.java which has call to a native function _newobj. I am trying to dynamically link _newobj with env->RegisterNatives() in cbVMInit function in jvmTI agent.

      When I call env->FindClass("HeapTracker") the code seems to work and VM does not crash. When I try to search for env->FindClass("com/test/HeapTracker") VM crashes. Even if I call env->FindClass("some random name") VM crashes.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Can send the project sources if needed.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Would expect FindClass to return null if class can not be found.
      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x0000000000000000, pid=8202, tid=47491859187456
      #
      # JRE version: 7.0-b147
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (21.0-b17 mixed mode linux-amd64 compressed oops)
      # Problematic frame:
      # C 0x0000000000000000
      #
      # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.sun.com/bugreport/crash.jsp
      #

      --------------- T H R E A D ---------------

      Current thread (0x0000000000833000): JavaThread "Unknown thread" [_thread_in_Java, id=8203, stack(0x00002b318f558000,0x00002b318f659000)]

      siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x0000000000000000

      Registers:
      RAX=0x0000000000000000, RBX=0x00000000bee14ac0, RCX=0x00000000ec000d98, RDX=0x000000000c800001
      RSP=0x00002b318f656ee0, RBP=0x00002b318f656f30, RSI=0x0000000000000001, RDI=0x0000000000833000
      R8 =0x0000000000855770, R9 =0x0000000000005240, R10=0x00002b318f288c20, R11=0x00002b318e88d8e0
      R12=0x0000000000000000, R13=0x00002b318f656ee8, R14=0x00002b318f656f38, R15=0x0000000000833000
      RIP=0x0000000000000000, EFLAGS=0x0000000000010246, CSGSFS=0x0000000000000033, ERR=0x0000000000000014
        TRAPNO=0x000000000000000e

        Top of Stack: (sp=0x00002b318f656ee0)
      0x00002b318f656ee0: 00002b3190e8a290 00000000ec000d98
      0x00002b318f656ef0: 00002b318f656ef0 00000000bee23ccb
      0x00002b318f656f00: 00002b318f656f38 00000000beea76e8
      0x00002b318f656f10: 0000000000000000 00000000bee23d08
      0x00002b318f656f20: 00002b318f656ee8 00002b318f656f40
      0x00002b318f656f30: 00002b318f656fa0 00002b3190e84438
      0x00002b318f656f40: 0000000000001fa0 00002b318f657130
      0x00002b318f656f50: 00002b318f657020 00002b318f6570b0
      0x00002b318f656f60: 0000000000833000 0000000000834060
      0x00002b318f656f70: 00002b318f656fe0 00002b318f657138
      0x00002b318f656f80: 000000000000000a 00000000bee23d08
      0x00002b318f656f90: 00002b3190e941e0 00002b318f6570b8
      0x00002b318f656fa0: 00002b318f657080 00002b318eb22005
      0x00002b318f656fb0: 00002b3100000000 0000000000833000
      0x00002b318f656fc0: 0000000000833000 00002b318f656fe0
      0x00002b318f656fd0: 00002b3190e941e0 000000000000000a
      0x00002b318f656fe0: 0000000000833000 000000000086e040
      0x00002b318f656ff0: 00000000bee23d08 0000000000000000
      0x00002b318f657000: 0000000000000000 0000000000000000
      0x00002b318f657010: 0000000000000000 00002b318f657130
      0x00002b318f657020: 0000000000833000 0000000000830aa0
      0x00002b318f657030: 0000000000833f00 0000000000834068
      0x00002b318f657040: 00000000008342e8 00002b318f657250
      0x00002b318f657050: ffffffff00000004 00000000bee23d08
      0x00002b318f657060: 0000000000833000 00002b318f6571e0
      0x00002b318f657070: 00000000bee02d48 00002b318f657160
      0x00002b318f657080: 00002b318f6570a0 00002b318eb20b38
      0x00002b318f657090: 00000000bee23d08 0000000000834060
      0x00002b318f6570a0: 00002b318f657150 00002b318eae9cea
      0x00002b318f6570b0: 00002b318f657100 0000000000000000
      0x00002b318f6570c0: 00002b318f6570e0 00007fffeb5ff714
      0x00002b318f6570d0: 00002b318f657120 0000000000000000

      Instructions: (pc=0x0000000000000000)
      0xffffffffffffffe0:

      Register to memory mapping:

      RAX=0x0000000000000000 is an unknown value
      RBX=0x00000000bee14ac0 is an oop
      {method}
       - klass: {other class}
      RCX=0x00000000ec000d98 is an oop
      java.lang.Class
       - klass: 'java/lang/Class'
      RDX=0x000000000c800001 is an unknown value
      RSP=0x00002b318f656ee0 is pointing into the stack for thread: 0x0000000000833000
      RBP=0x00002b318f656f30 is pointing into the stack for thread: 0x0000000000833000
      RSI=0x0000000000000001 is an unknown value
      RDI=0x0000000000833000 is a thread
      R8 =0x0000000000855770 is an unknown value
      R9 =0x0000000000005240 is an unknown value
      R10=0x00002b318f288c20: <offset 0xc7bc20> in /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/server/libjvm.so at 0x00002b318e60d000
      R11=0x00002b318e88d8e0: <offset 0x2808e0> in /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/server/libjvm.so at 0x00002b318e60d000
      R12=0x0000000000000000 is an unknown value
      R13=0x00002b318f656ee8 is pointing into the stack for thread: 0x0000000000833000
      R14=0x00002b318f656f38 is pointing into the stack for thread: 0x0000000000833000
      R15=0x0000000000833000 is a thread


      Stack: [0x00002b318f558000,0x00002b318f659000], sp=0x00002b318f656ee0, free space=1019k

      --------------- P R O C E S S ---------------

      Java Threads: ( => current thread )
      =>0x0000000000833000 JavaThread "Unknown thread" [_thread_in_Java, id=8203, stack(0x00002b318f558000,0x00002b318f659000)]

      Other Threads:
        0x00000000008b3800 VMThread [stack: 0x00002b3194a14000,0x00002b3194b15000] [id=8206]

      VM state:not at safepoint (normal execution)

      VM Mutex/Monitor currently owned by a thread: None

      Heap
       PSYoungGen total 17920K, used 308K [0x00000000ec000000, 0x00000000ed3f0000, 0x0000000100000000)
        eden space 15424K, 2% used [0x00000000ec000000,0x00000000ec04d258,0x00000000ecf10000)
        from space 2496K, 0% used [0x00000000ed180000,0x00000000ed180000,0x00000000ed3f0000)
        to space 2496K, 0% used [0x00000000ecf10000,0x00000000ecf10000,0x00000000ed180000)
       PSOldGen total 40960K, used 0K [0x00000000c4000000, 0x00000000c6800000, 0x00000000ec000000)
        object space 40960K, 0% used [0x00000000c4000000,0x00000000c4000000,0x00000000c6800000)
       PSPermGen total 21248K, used 685K [0x00000000bee00000, 0x00000000c02c0000, 0x00000000c4000000)
        object space 21248K, 3% used [0x00000000bee00000,0x00000000beeab5a8,0x00000000c02c0000)

      Code Cache [0x00002b3190e84000, 0x00002b31910f4000, 0x00002b3193e84000)
       total_blobs=46 nmethods=0 adapters=20 free_code_cache=48834Kb largest_free_block=50005504

      Dynamic libraries:
      00400000-00401000 r-xp 00000000 08:07 19151585 /home/dawid/Workspace/jdk1.7.0/bin/java
      00600000-00601000 rw-p 00000000 08:07 19151585 /home/dawid/Workspace/jdk1.7.0/bin/java
      00829000-008d0000 rw-p 00000000 00:00 0 [heap]
      bee00000-c02c0000 rw-p 00000000 00:00 0
      c02c0000-c4000000 rw-p 00000000 00:00 0
      c4000000-c6800000 rw-p 00000000 00:00 0
      c6800000-ec000000 rw-p 00000000 00:00 0
      ec000000-ed3f0000 rw-p 00000000 00:00 0
      ed3f0000-100000000 rw-p 00000000 00:00 0
      2b318da2e000-2b318da4e000 r-xp 00000000 08:05 524368 /lib/ld-2.11.1.so
      2b318da4e000-2b318da50000 rw-p 00000000 00:00 0
      2b318dc4d000-2b318dc4e000 r--p 0001f000 08:05 524368 /lib/ld-2.11.1.so
      2b318dc4e000-2b318dc4f000 rw-p 00020000 08:05 524368 /lib/ld-2.11.1.so
      2b318dc4f000-2b318dc50000 rw-p 00000000 00:00 0
      2b318dc50000-2b318dc68000 r-xp 00000000 08:05 531669 /lib/libpthread-2.11.1.so
      2b318dc68000-2b318de67000 ---p 00018000 08:05 531669 /lib/libpthread-2.11.1.so
      2b318de67000-2b318de68000 r--p 00017000 08:05 531669 /lib/libpthread-2.11.1.so
      2b318de68000-2b318de69000 rw-p 00018000 08:05 531669 /lib/libpthread-2.11.1.so
      2b318de69000-2b318de6e000 rw-p 00000000 00:00 0
      2b318de6e000-2b318de84000 r-xp 00000000 08:07 19152743 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/jli/libjli.so
      2b318de84000-2b318e083000 ---p 00016000 08:07 19152743 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/jli/libjli.so
      2b318e083000-2b318e084000 rw-p 00015000 08:07 19152743 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/jli/libjli.so
      2b318e084000-2b318e086000 r-xp 00000000 08:05 524843 /lib/libdl-2.11.1.so
      2b318e086000-2b318e286000 ---p 00002000 08:05 524843 /lib/libdl-2.11.1.so
      2b318e286000-2b318e287000 r--p 00002000 08:05 524843 /lib/libdl-2.11.1.so
      2b318e287000-2b318e288000 rw-p 00003000 08:05 524843 /lib/libdl-2.11.1.so
      2b318e288000-2b318e402000 r-xp 00000000 08:05 524840 /lib/libc-2.11.1.so
      2b318e402000-2b318e601000 ---p 0017a000 08:05 524840 /lib/libc-2.11.1.so
      2b318e601000-2b318e605000 r--p 00179000 08:05 524840 /lib/libc-2.11.1.so
      2b318e605000-2b318e606000 rw-p 0017d000 08:05 524840 /lib/libc-2.11.1.so
      2b318e606000-2b318e60d000 rw-p 00000000 00:00 0
      2b318e60d000-2b318efdd000 r-xp 00000000 08:07 19152753 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/server/libjvm.so
      2b318efdd000-2b318f1dd000 ---p 009d0000 08:07 19152753 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/server/libjvm.so
      2b318f1dd000-2b318f278000 rw-p 009d0000 08:07 19152753 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/server/libjvm.so
      2b318f278000-2b318f2b1000 rw-p 00000000 00:00 0
      2b318f2d5000-2b318f357000 r-xp 00000000 08:05 524844 /lib/libm-2.11.1.so
      2b318f357000-2b318f556000 ---p 00082000 08:05 524844 /lib/libm-2.11.1.so
      2b318f556000-2b318f557000 r--p 00081000 08:05 524844 /lib/libm-2.11.1.so
      2b318f557000-2b318f558000 rw-p 00082000 08:05 524844 /lib/libm-2.11.1.so
      2b318f558000-2b318f55b000 ---p 00000000 00:00 0
      2b318f55b000-2b318f659000 rw-p 00000000 00:00 0
      2b318f67d000-2b318f684000 r-xp 00000000 08:05 531671 /lib/librt-2.11.1.so
      2b318f684000-2b318f883000 ---p 00007000 08:05 531671 /lib/librt-2.11.1.so
      2b318f883000-2b318f884000 r--p 00006000 08:05 531671 /lib/librt-2.11.1.so
      2b318f884000-2b318f885000 rw-p 00007000 08:05 531671 /lib/librt-2.11.1.so
      2b318f885000-2b318f894000 r-xp 00000000 08:07 19152720 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/libverify.so
      2b318f894000-2b318fa93000 ---p 0000f000 08:07 19152720 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/libverify.so
      2b318fa93000-2b318fa95000 rw-p 0000e000 08:07 19152720 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/libverify.so
      2b318fa95000-2b318fabe000 r-xp 00000000 08:07 19152751 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/libjava.so
      2b318fabe000-2b318fcbe000 ---p 00029000 08:07 19152751 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/libjava.so
      2b318fcbe000-2b318fcc0000 rw-p 00029000 08:07 19152751 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/libjava.so
      2b318fcc0000-2b318fcc1000 r--p 00000000 00:00 0
      2b318fcc1000-2b318fcc2000 rw-p 00000000 00:00 0
      2b318fcc2000-2b318fcd6000 r-xp 00000000 08:07 19141681 /home/dawid/Workspace/HeapTrace/libheapTracker.so
      2b318fcd6000-2b318fed5000 ---p 00014000 08:07 19141681 /home/dawid/Workspace/HeapTrace/libheapTracker.so
      2b318fed5000-2b318fed6000 r--p 00013000 08:07 19141681 /home/dawid/Workspace/HeapTrace/libheapTracker.so
      2b318fed6000-2b318fed7000 rw-p 00014000 08:07 19141681 /home/dawid/Workspace/HeapTrace/libheapTracker.so
      2b318fed7000-2b318fedf000 rw-p 00000000 00:00 0
      2b318fedf000-2b318fee7000 rw-s 00000000 08:05 1967626 /tmp/hsperfdata_dawid/8202
      2b318ff03000-2b318fff9000 r-xp 00000000 08:05 2627497 /usr/lib/libstdc++.so.6.0.13
      2b318fff9000-2b31901f9000 ---p 000f6000 08:05 2627497 /usr/lib/libstdc++.so.6.0.13
      2b31901f9000-2b3190200000 r--p 000f6000 08:05 2627497 /usr/lib/libstdc++.so.6.0.13
      2b3190200000-2b3190202000 rw-p 000fd000 08:05 2627497 /usr/lib/libstdc++.so.6.0.13
      2b3190202000-2b3190217000 rw-p 00000000 00:00 0
      2b3190217000-2b319022d000 r-xp 00000000 08:05 524369 /lib/libgcc_s.so.1
      2b319022d000-2b319042c000 ---p 00016000 08:05 524369 /lib/libgcc_s.so.1
      2b319042c000-2b319042d000 r--p 00015000 08:05 524369 /lib/libgcc_s.so.1
      2b319042d000-2b319042e000 rw-p 00016000 08:05 524369 /lib/libgcc_s.so.1
      2b319042e000-2b3190436000 r-xp 00000000 08:05 531618 /lib/libnss_compat-2.11.1.so
      2b3190436000-2b3190635000 ---p 00008000 08:05 531618 /lib/libnss_compat-2.11.1.so
      2b3190635000-2b3190636000 r--p 00007000 08:05 531618 /lib/libnss_compat-2.11.1.so
      2b3190636000-2b3190637000 rw-p 00008000 08:05 531618 /lib/libnss_compat-2.11.1.so
      2b3190637000-2b319064e000 r-xp 00000000 08:05 524846 /lib/libnsl-2.11.1.so
      2b319064e000-2b319084d000 ---p 00017000 08:05 524846 /lib/libnsl-2.11.1.so
      2b319084d000-2b319084e000 r--p 00016000 08:05 524846 /lib/libnsl-2.11.1.so
      2b319084e000-2b319084f000 rw-p 00017000 08:05 524846 /lib/libnsl-2.11.1.so
      2b319084f000-2b3190851000 rw-p 00000000 00:00 0
      2b3190851000-2b319085b000 r-xp 00000000 08:05 531666 /lib/libnss_nis-2.11.1.so
      2b319085b000-2b3190a5a000 ---p 0000a000 08:05 531666 /lib/libnss_nis-2.11.1.so
      2b3190a5a000-2b3190a5b000 r--p 00009000 08:05 531666 /lib/libnss_nis-2.11.1.so
      2b3190a5b000-2b3190a5c000 rw-p 0000a000 08:05 531666 /lib/libnss_nis-2.11.1.so
      2b3190a5c000-2b3190a68000 r-xp 00000000 08:05 531664 /lib/libnss_files-2.11.1.so
      2b3190a68000-2b3190c67000 ---p 0000c000 08:05 531664 /lib/libnss_files-2.11.1.so
      2b3190c67000-2b3190c68000 r--p 0000b000 08:05 531664 /lib/libnss_files-2.11.1.so
      2b3190c68000-2b3190c69000 rw-p 0000c000 08:05 531664 /lib/libnss_files-2.11.1.so
      2b3190c69000-2b3190c83000 r-xp 00000000 08:07 19152731 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/libzip.so
      2b3190c83000-2b3190e83000 ---p 0001a000 08:07 19152731 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/libzip.so
      2b3190e83000-2b3190e84000 rw-p 0001a000 08:07 19152731 /home/dawid/Workspace/jdk1.7.0/jre/lib/amd64/libzip.so
      2b3190e84000-2b31910f4000 rwxp 00000000 00:00 0
      2b31910f4000-2b3193e84000 rw-p 00000000 00:00 0
      2b3193e84000-2b3193e8e000 rw-p 00000000 00:00 0
      2b3193e8e000-2b3193f44000 rw-p 00000000 00:00 0
      2b3193f44000-2b3193f4f000 rw-p 00000000 00:00 0
      2b3193f4f000-2b3193f6d000 rw-p 00000000 00:00 0
      2b3193f6d000-2b3193f81000 rw-p 00000000 00:00 0
      2b3193f81000-2b31940ad000 rw-p 00000000 00:00 0
      2b31940ad000-2b31940b7000 rw-p 00000000 00:00 0
      2b31940b7000-2b319414d000 rw-p 00000000 00:00 0
      2b319414d000-2b3194162000 rw-p 00000000 00:00 0
      2b3194162000-2b319428e000 rw-p 00000000 00:00 0
      2b319428e000-2b3194299000 rw-p 00000000 00:00 0
      2b3194299000-2b31942b7000 rw-p 00000000 00:00 0
      2b31942b7000-2b31942b8000 ---p 00000000 00:00 0
      2b31942b8000-2b31943b8000 rw-p 00000000 00:00 0
      2b31943b8000-2b31943b9000 ---p 00000000 00:00 0
      2b31943b9000-2b31944e1000 r


      ( This report has more than 16,000 characters and has been truncated. )

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: