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

GCC 4.6 changes default setting for omit-frame-pointer which breaks hotspot stack walking

    Details

    • Subcomponent:
    • Resolved In Build:
      b48
    • CPU:
      x86
    • OS:
      linux
    • Verification:
      Not verified

      Backports

        Description

        From:

        http://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Optimize-Options.html#index-fomit_002dframe_002dpointer-692

        Starting with GCC version 4.6, the default setting (when not optimizing for size) for 32-bit Linux x86 and 32-bit Darwin x86 targets has been changed to -fomit-frame-pointer. The default can be reverted to -fno-omit-frame-pointer by configuring GCC with the --enable-frame-pointer configure option.

        ---

        If you build hotspot with gcc 4.6+ stack walking is broken. This is mostly easily seen by enabling Native Memory Tracking. Even "java -XX:NativeMemoryTracking=detail -version" crashes

        #37 <signal handler called>
        #38 0xf6d4054c in os::is_first_C_frame(frame*) ()
           from /export/users/dh198349/hotspot-testing/images/j2sdk-image/jre/lib/i386/server/libjvm.so
        #39 0xf6d4e568 in os::current_frame() ()
           from /export/users/dh198349/hotspot-testing/images/j2sdk-image/jre/lib/i386/server/libjvm.so
        #40 0xf6d51acf in os::get_caller_pc(int) ()
           from /export/users/dh198349/hotspot-testing/images/j2sdk-image/jre/lib/i386/server/libjvm.so
        #41 0xf6a47141 in CHeapObj<(unsigned short)1792>::operator new(unsigned int, unsigned char*) [clone .constprop.92] ()
           from /export/users/dh198349/hotspot-testing/images/j2sdk-image/jre/lib/i386/server/libjvm.so
        #42 0xf6a47272 in Events::init() ()
           from /export/users/dh198349/hotspot-testing/images/j2sdk-image/jre/lib/i386/server/libjvm.so
        #43 0xf6ae176f in vm_init_globals() ()
           from /export/users/dh198349/hotspot-testing/images/j2sdk-image/jre/lib/i386/server/libjvm.so
        #44 0xf6e79a2c in Threads::create_vm(JavaVMInitArgs*, bool*) ()
           from /export/users/dh198349/hotspot-testing/images/j2sdk-image/jre/lib/i386/server/libjvm.so
        #45 0xf6b613b5 in JNI_CreateJavaVM ()

        Debug build shows an assertion failure for a null PC.

        Hotspot relies on the frame pointer being present so we will need to explicitly enable it.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  hseigel Harold Seigel
                  Reporter:
                  dholmes David Holmes
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Due:
                    Created:
                    Updated:
                    Resolved: