Skip to content

Commit 2e70bc3

Browse files
committed
8268626: Remove native pre-jdk9 support for jtreg failure handler
Reviewed-by: erikj
1 parent e59acd9 commit 2e70bc3

4 files changed

Lines changed: 4 additions & 100 deletions

File tree

make/test/BuildFailureHandler.gmk

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -60,24 +60,6 @@ $(eval $(call SetupJavaCompilation, BUILD_FAILURE_HANDLER, \
6060

6161
TARGETS += $(BUILD_FAILURE_HANDLER)
6262

63-
################################################################################
64-
65-
ifeq ($(call isTargetOs, windows), true)
66-
67-
$(eval $(call SetupNativeCompilation, BUILD_LIBTIMEOUT_HANDLER, \
68-
NAME := timeoutHandler, \
69-
SRC := $(FH_BASEDIR)/src/windows/native/libtimeoutHandler, \
70-
OBJECT_DIR := $(FH_SUPPORT)/libtimeoutHandler, \
71-
OUTPUT_DIR := $(FH_SUPPORT), \
72-
CFLAGS := $(CFLAGS_JDKLIB), \
73-
LDFLAGS := $(LDFLAGS_JDKLIB), \
74-
OPTIMIZATION := LOW, \
75-
))
76-
77-
TARGETS += $(BUILD_LIBTIMEOUT_HANDLER)
78-
79-
endif
80-
8163
################################################################################
8264
# Targets for building test-image.
8365
################################################################################
@@ -99,10 +81,6 @@ IMAGES_TARGETS += $(COPY_FH)
9981
# Use JTREG_TESTS for jtreg tests parameter
10082
#
10183
RUN_DIR := $(FH_SUPPORT)/test
102-
# Add the dir of the dll to the path on windows
103-
ifeq ($(call isTargetOs, windows), true)
104-
export PATH := $(PATH);$(FH_SUPPORT)
105-
endif
10684

10785
test:
10886
$(RM) -r $(RUN_DIR)

test/failure_handler/Makefile

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,10 @@ SRC_DIR := $(shell cygpath -m "${SRC_DIR}")
5353
JAVA_HOME := $(shell cygpath -m "${JAVA_HOME}")
5454
JTREG_HOME := $(shell cygpath -m "${JTREG_HOME}")
5555
CLASSPATH := $(shell cygpath -pm "${CLASSPATH}")
56-
CC := "cl.exe"
5756
endif
5857

5958
all: clean test
6059

61-
native: require_env
62-
ifeq ("${OS_NAME}", "Cygwin")
63-
"${CC}" src/windows/native/jdk/test/failurehandler/jtreg/*.c \
64-
-I"$(shell cygpath -w "${JAVA_HOME}/include")" \
65-
-I"$(shell cygpath -w "${JAVA_HOME}/include/win32")" \
66-
/link /DLL /OUT:timeoutHandler.dll
67-
endif
68-
6960
check_defined = $(foreach 1,$1,$(__check_defined))
7061
__check_defined = $(if $(value $1),, $(error $1 is not set))
7162

@@ -112,7 +103,7 @@ require_env:
112103
clean:
113104
rm -rf "${BUILD_DIR}" "${RUN_DIR}"
114105

115-
build: classes native
106+
build: classes
116107

117-
.PHONY: all build classes native test require_env clean
108+
.PHONY: all build classes test require_env clean
118109
.DEFAULT: all

test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
3030
import java.io.FileWriter;
3131
import java.io.IOException;
3232
import java.io.PrintWriter;
33-
import java.lang.reflect.Field;
3433
import java.nio.file.Path;
3534

3635
/**
@@ -102,33 +101,6 @@ protected void runActions(Process process, long pid)
102101
}
103102
}
104103

105-
@Override
106-
protected long getProcessId(Process process) {
107-
long result = super.getProcessId(process);
108-
if (result == 0L) {
109-
/* jtreg didn't find pid, most probably we are on JDK < 9
110-
there is no Process::getPid */
111-
if (HAS_NATIVE_LIBRARY && "windows".equals(OS.current().family)) {
112-
try {
113-
Field field = process.getClass().getDeclaredField("handle");
114-
boolean old = field.canAccess(process);
115-
try {
116-
field.setAccessible(true);
117-
long handle = field.getLong(process);
118-
result = getWin32Pid(handle);
119-
} finally {
120-
field.setAccessible(old);
121-
}
122-
} catch (ReflectiveOperationException e) {
123-
e.printStackTrace(log);
124-
}
125-
}
126-
}
127-
return result;
128-
}
129-
130-
private native long getWin32Pid(long handle);
131-
132104
private void runGatherer(String name, Path workDir, PrintWriter log,
133105
PrintWriter out, long pid) {
134106
try (HtmlPage html = new HtmlPage(out)) {

test/failure_handler/src/windows/native/libtimeoutHandler/GatherProcessInfoTimeoutHandler.c

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)