Skip to content

Commit d24b7b7

Browse files
author
Roger Riggs
committedAug 23, 2022
8276651: java/lang/ProcessHandle tests fail with "RuntimeException: Input/output error" in java.lang.ProcessHandleImpl$Info.info0
Reviewed-by: jpai, alanb
1 parent 8a45abd commit d24b7b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/java.base/macosx/native/libjava/ProcessHandleImpl_macosx.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) {
272272
mib[2] = pid;
273273
size = (size_t) maxargs;
274274
if (sysctl(mib, 3, args, &size, NULL, 0) == -1) {
275-
if (errno != EINVAL) {
275+
if (errno != EINVAL && errno != EIO) {
276+
// If the pid is invalid, the information returned is empty and no exception
276277
JNU_ThrowByNameWithLastError(env,
277278
"java/lang/RuntimeException", "sysctl failed");
278279
}
@@ -300,4 +301,3 @@ void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) {
300301
// Free the arg buffer
301302
free(args);
302303
}
303-

5 commit comments

Comments
 (5)

openjdk-notifier[bot] commented on Aug 23, 2022

@openjdk-notifier[bot]

MBaesken commented on Aug 22, 2023

@MBaesken
Member

/backport jdk17u-dev

openjdk[bot] commented on Aug 22, 2023

@openjdk[bot]

@MBaesken the backport was successfully created on the branch MBaesken-backport-d24b7b70 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit d24b7b70 from the openjdk/jdk repository.

The commit being backported was authored by Roger Riggs on 23 Aug 2022 and was reviewed by Jaikiran Pai and Alan Bateman.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git MBaesken-backport-d24b7b70:MBaesken-backport-d24b7b70
$ git checkout MBaesken-backport-d24b7b70
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git MBaesken-backport-d24b7b70

MBaesken commented on Aug 25, 2023

@MBaesken
Member

/backport jdk11u-dev

openjdk[bot] commented on Aug 25, 2023

@openjdk[bot]

@MBaesken the backport was successfully created on the branch MBaesken-backport-d24b7b70 in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit d24b7b70 from the openjdk/jdk repository.

The commit being backported was authored by Roger Riggs on 23 Aug 2022 and was reviewed by Jaikiran Pai and Alan Bateman.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev.git MBaesken-backport-d24b7b70:MBaesken-backport-d24b7b70
$ git checkout MBaesken-backport-d24b7b70
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev.git MBaesken-backport-d24b7b70
Please sign in to comment.