JDK-8152899 : Xcode 7.3 problems
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: os_x
  • Submitted: 2016-03-28
  • Updated: 2018-01-29
  • Resolved: 2018-01-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11Resolved
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
There are 3 libsaproc issues, compiling libsaproc under Xcode 7.3 (need to modify gcc.make first to use make):

/Volumes/Work/bugs/0000000/jdk9/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m:691:21: warning: 'ePtAttachDeprecated' is deprecated: PT_ATTACH is deprecated. See PT_ATTACHEXC [-Wdeprecated-declarations]
  if ((res = ptrace(PT_ATTACH, pid, 0, 0)) < 0) {
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/ptrace.h:85:19: note: expanded from macro 'PT_ATTACH'
#define PT_ATTACH       ePtAttachDeprecated     /* trace some running process */
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/ptrace.h:71:2: note: 'ePtAttachDeprecated' has been explicitly marked deprecated here
        ePtAttachDeprecated __deprecated_enum_msg("PT_ATTACH is deprecated. See PT_ATTACHEXC") = 10
        ^

Comments
The correct fix for this: (using PT_ATTACHEXC and handling the mach exceptions delivered due to this) is at: http://cr.openjdk.java.net/~jgeorge/8184042/webrev.00/ and should get done as a part of JDK-8189429.
29-01-2018

JDK-8184042 was then used to go back to using the deprecated PT_ATTACH, but it turned off the compiler warning.
26-01-2018

As a part of the changes for 8182299, the deprecated PT_ATTACH subcommand of ptrace was replaced by PT_ATTACHEXC.
24-07-2017

This got done as a part of JDK-8182299 (Enable disabled clang warnings, build on OSX 10 + Xcode 8).
24-07-2017

Same submitter (JDK-8166246) has provided modified patch for this issue 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
19-09-2016

Submitter of JDK-8166184 has provided following patch for fixing this issue == diff -r a20da289f646 src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m --- a/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m Thu Sep 08 21:11:53 2016 +0000 +++ b/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m Wed Sep 14 17:35:58 2016 -0700 @@ -688,8 +688,8 @@ // attach to a process/thread specified by "pid" static bool ptrace_attach(pid_t pid) { int res; - if ((res = ptrace(PT_ATTACH, pid, 0, 0)) < 0) { - print_error("ptrace(PT_ATTACH, %d) failed with %d\n", pid, res); + if ((res = ptrace(PT_ATTACHEXC, pid, 0, 0)) < 0) { + print_error("ptrace(PT_ATTACHEXC, %d) failed with %d\n", pid, res); return false; } else { return ptrace_waitpid(pid); ==
16-09-2016

Temporarily stopping working on this to work on higher priority issue.
08-04-2016

ILW = L (Xcode 7.3), H (occurs always), H (no workaround) = P4
31-03-2016

I can take it if the svc team needs help on this.
28-03-2016