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

Crash in Method::checked_resolve_jmethod_id(_jmethodID*)

    Details

    • Subcomponent:
    • Introduced In Version:
      8
    • Resolved In Build:
      b01
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Fix failed

      Backports

        Description

        VisualVM's memory profiling with allocation stacktraces crashes JVM in Method::checked_resolve_jmethod_id(). Original VisualVM bug report is here: https://java.net/jira/browse/VISUALVM-611

        Example of hs_err is here:
        http://phonehome.se.oracle.com:8080/PHReport/crashInfo.jsp?crashLogID=13277911

          Issue Links

            Activity

            Hide
            shshahma Shafi Ahmad added a comment -
            Able to reproduce with the latest code base in jdk8.

            (gdb) bt
            #0 0x00007ffff782c267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
            #1 0x00007ffff782deca in __GI_abort () at abort.c:89
            #2 0x00007ffff6ccaab9 in os::abort(bool) () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
            #3 0x00007ffff6e87a74 in VMError::report_and_die() () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
            #4 0x00007ffff6cd3b77 in JVM_handle_linux_signal () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
            #5 0x00007ffff6cc7e88 in signalHandler(int, siginfo_t*, void*) () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
            #6 <signal handler called>
            #7 0x00007ffff6c5bac6 in Method::checked_resolve_jmethod_id(_jmethodID*) () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
            #8 0x00007ffff6ac9ff2 in jvmti_GetMethodDeclaringClass () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
            #9 0x00007fffdc6adfd3 in Java_org_netbeans_lib_profiler_server_system_Stacks_getMethodNamesForJMethodIds ()
               from /usr/lib/jvm/java-8-oracle/lib/visualvm/profiler/lib/deployed/jdk16/linux-amd64/libprofilerinterface.so
            Show
            shshahma Shafi Ahmad added a comment - Able to reproduce with the latest code base in jdk8. (gdb) bt #0 0x00007ffff782c267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55 #1 0x00007ffff782deca in __GI_abort () at abort.c:89 #2 0x00007ffff6ccaab9 in os::abort(bool) () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so #3 0x00007ffff6e87a74 in VMError::report_and_die() () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so #4 0x00007ffff6cd3b77 in JVM_handle_linux_signal () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so #5 0x00007ffff6cc7e88 in signalHandler(int, siginfo_t*, void*) () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so #6 <signal handler called> #7 0x00007ffff6c5bac6 in Method::checked_resolve_jmethod_id(_jmethodID*) () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so #8 0x00007ffff6ac9ff2 in jvmti_GetMethodDeclaringClass () from /home/shafi/Java/jdk8/jdk8u-dev/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so #9 0x00007fffdc6adfd3 in Java_org_netbeans_lib_profiler_server_system_Stacks_getMethodNamesForJMethodIds ()    from /usr/lib/jvm/java-8-oracle/lib/visualvm/profiler/lib/deployed/jdk16/linux-amd64/libprofilerinterface.so
            Hide
            shshahma Shafi Ahmad added a comment -
            Even after the suggested change I am getting crash in same location

            #0 Method::checked_resolve_jmethod_id (mid=0x7fff9c0ba318) at /home/shafi/Java/jdk8/jdk8u-dev/hotspot/src/share/vm/oops/method.cpp:1937
            1937 if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) {
            (gdb) p o
            $488 = (Method *) 0x7fffddbeac50
            (gdb) l
            1932 }
            1933
            1934 Method* Method::checked_resolve_jmethod_id(jmethodID mid) {
            1935 if (mid == NULL) return NULL;
            1936 Method* o = resolve_jmethod_id(mid);
            1937 if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) {
            1938 return NULL;
            1939 }
            1940 return o;
            1941 };

            Seems Method object o is not valid as v-table pointer is not pointing to valid memory address " _vptr.Metadata = 0xc"

            (gdb) p *o
            $489 = {
              <Metadata> = {
                <MetaspaceObj> = {<No data fields>},
                members of Metadata:
                _vptr.Metadata = 0xc,
                _valid = -574708816
              },
              members of Method:
              _constMethod = 0x7fffddbea030,
              _method_data = 0x7fffadd28438,
              _method_counters = 0x0,
              _access_flags = {
                _flags = 0
              },
              _vtable_index = 0,
              _method_size = 0,
              _intrinsic_id = 0 '\000',
              _jfr_towrite = 0 '\000',
              _caller_sensitive = 0 '\000',
              _force_inline = 0 '\000',
              _hidden = 0 '\000',
              _dont_inline = 0 '\000',
              _has_injected_profile = 0 '\000',
              _compiled_invocation_count = 0,
              _i2i_entry = 0x0,
              _adapter = 0x0,
              _from_compiled_entry = 0x0,
              _code = 0x0,
              _from_interpreted_entry = 0x0,
              static extra_stack_entries_for_jsr292 = 1
            }
            Show
            shshahma Shafi Ahmad added a comment - Even after the suggested change I am getting crash in same location #0 Method::checked_resolve_jmethod_id (mid=0x7fff9c0ba318) at /home/shafi/Java/jdk8/jdk8u-dev/hotspot/src/share/vm/oops/method.cpp:1937 1937 if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) { (gdb) p o $488 = (Method *) 0x7fffddbeac50 (gdb) l 1932 } 1933 1934 Method* Method::checked_resolve_jmethod_id(jmethodID mid) { 1935 if (mid == NULL) return NULL; 1936 Method* o = resolve_jmethod_id(mid); 1937 if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) { 1938 return NULL; 1939 } 1940 return o; 1941 }; Seems Method object o is not valid as v-table pointer is not pointing to valid memory address " _vptr.Metadata = 0xc" (gdb) p *o $489 = {   <Metadata> = {     <MetaspaceObj> = {<No data fields>},     members of Metadata:     _vptr.Metadata = 0xc,     _valid = -574708816   },   members of Method:   _constMethod = 0x7fffddbea030,   _method_data = 0x7fffadd28438,   _method_counters = 0x0,   _access_flags = {     _flags = 0   },   _vtable_index = 0,   _method_size = 0,   _intrinsic_id = 0 '\000',   _jfr_towrite = 0 '\000',   _caller_sensitive = 0 '\000',   _force_inline = 0 '\000',   _hidden = 0 '\000',   _dont_inline = 0 '\000',   _has_injected_profile = 0 '\000',   _compiled_invocation_count = 0,   _i2i_entry = 0x0,   _adapter = 0x0,   _from_compiled_entry = 0x0,   _code = 0x0,   _from_interpreted_entry = 0x0,   static extra_stack_entries_for_jsr292 = 1 }
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/rev/fde446cb8e19
            User: kevinw
            Date: 2016-06-11 13:07:50 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/rev/fde446cb8e19 User: kevinw Date: 2016-06-11 13:07:50 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/rev/fde446cb8e19
            User: robm
            Date: 2016-06-17 20:21:31 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/rev/fde446cb8e19 User: robm Date: 2016-06-17 20:21:31 +0000
            Hide
            avorobye Alexander Vorobyev (Inactive) added a comment - - edited
            Java crash can be observed in JDK 1.8.0_112b02 on Ubuntu x64. So fix failed. See the newly created issue for information - JDK-8161144.
            Show
            avorobye Alexander Vorobyev (Inactive) added a comment - - edited Java crash can be observed in JDK 1.8.0_112b02 on Ubuntu x64. So fix failed. See the newly created issue for information - JDK-8161144 .

              People

              • Assignee:
                shshahma Shafi Ahmad
                Reporter:
                thurka Tomáš Hůrka
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: