On Thu, 1 Oct 2026 05:53:45 GMT, Chris Plummer <[email protected]> wrote:

>> On macOS 26.6.2 and 27, all the SA process tests are failing with a timeout. 
>> I manually attached to a java process using clhsdb, and after the detach the 
>> debuggee process was left suspended, so this seems to be the issue causing 
>> the timeouts. Details in first comment.
>> 
>> - Tested with all svc tier1 through tier8 testing on macosx-aarch64-debug.
>> - Ran all SA tests on various mach5 hosts 50 times each on macosx-aarch64 
>> and macosx-aarch64-debug.
>> - Tested on macOS 26.6.2 personal device by running serviceability/sa 120 
>> times on combination of debug and product builds
>> - Tested on macOS 27 mach5 devices by running serviceability/sa 100 times.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Chris Plummer has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   resolve issue with SA's libproc.h conflict with OSX header by the same name

Just to assist those not that familiar with macOS APIs, macOS sits on top of a 
lower level OS called darwin, which has a kernel called XNU. XNU is a 
combination of Mach (which handles low level task management, among other 
things) and BSD (which provides the ptrace facility). The SA attach support 
uses a combination of Mach and BSD APIs, and it looks like this leads to some 
short term "out of sync" issues where after some Mach API calls, the Mach 
kernel is not quite ready for BSD process related functions to be called. 
Eventually the state of the Mach tasks settles, and the BSD ptrace() call can 
be made to do the detach without ill affects, like re-triggering the SIGSTOP 
done during the attach.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/33158#issuecomment-5943045490

Reply via email to