RFR: 8344671: Few JFR streaming tests fail with application not alive error on MacOS 15 [v2]

Larry Cable duke at openjdk.org
Thu Mar 27 22:19:21 UTC 2025


> on both Linux and MacOS libattach utilizes UNIX signal (QUIT) to cause a target JVM (attachee) to create the socket file used as transport for subsequent jcmds (and other attach based interactions) and to listen upon that for such.
> 
> it should be noted that the default behavior for QUIT (if not blocked or caught) is to terminate the signalled process.
> 
> during the early lifetime of a JVM, its signal handlers are not yet installed, and thus any signal such as QUIT will cause the
> default behavior to occur, in this case the JVM will be terminated.
> 
> this is why some tests are failing with "not alive"
> 
> the "fix" is similar in nature to that already implemented for linux (however using a different OS dependent mechanism to obtain the attachee JVM's signal masks: sysctl(2)).
> 
> the method "checkCatchesAndSendQuitTo" will now obtain the "attachee" JVM signal masks and only kill(QUIT) if the
> current masks indicate that the JVM's signals are now being handled.
> 
> the behavior in the success case is now identical to the previous implementation, however should the target JVM not 
> become "ready" (signal handlers installed) prior to the attach "timeout" occurring the attach operation will throw an
> "AttachNotSupportedException" with a suitable error message.
> 
> see also: https://bugs.openjdk.org/browse/JDK-8350766

Larry Cable has updated the pull request incrementally with three additional commits since the last revision:

 - Update src/jdk.attach/macosx/native/libattach/VirtualMachineImpl.c
   
   Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com>
 - Update src/jdk.attach/macosx/native/libattach/VirtualMachineImpl.c
   
   Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com>
 - Update src/jdk.attach/macosx/native/libattach/VirtualMachineImpl.c
   
   Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com>

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24085/files
  - new: https://git.openjdk.org/jdk/pull/24085/files/00161668..b2f465e4

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24085&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24085&range=00-01

  Stats: 4 lines in 1 file changed: 1 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/24085.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24085/head:pull/24085

PR: https://git.openjdk.org/jdk/pull/24085


More information about the serviceability-dev mailing list