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

More general fix for JDK-8152899

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      os_x

      Description

      FULL PRODUCT VERSION :
      [hotspot 827]$ java -version
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+135-jigsaw-nightly-h5480-20160909)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+135-jigsaw-nightly-h5480-2

      FULL OS VERSION :
      [hotspot 826]$ uname -a
      Darwin Scotts-iMac.local 15.6.0 Darwin Kernel Version 15.6.0: Mon Aug 29 20:21:34 PDT 2016; root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64

      10.11.6


      A DESCRIPTION OF THE PROBLEM :
      After looking at when the change to deprecate the PT_ATTACH flag for ptrace(2) was introduced, I have come up with a more general path that allows the MacosxDebuggerLocal.m code to compile under Xcode 7.3 and earlier by simple redefine the PT_ATTACH value to PT_ATTACHEXC when PT_ATTACHEXC is seen to be defined.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      [hotspot 825]$ hg diff -g
      diff --git a/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m b/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m
      --- a/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m
      +++ b/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m
      @@ -54,6 +54,12 @@
       #error UNSUPPORTED_ARCH
       #endif
       
      +// Redefine PT_ATTACH as PT_ATTACHEXC if PT_ATTACHEXC exists
      +#ifdef PT_ATTACHEXC
      +#undef PT_ATTACH
      +#define PT_ATTACH PT_ATTACHEXC
      +#endif
      +
       static jfieldID symbolicatorID = 0; // set in _init0
       static jfieldID taskID = 0; // set in _init0
       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                fmatte Fairoz Matte
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: