-
Bug
-
Resolution: Fixed
-
P4
-
11, 14, 15
-
b10
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8240763 | 14.0.2 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
JDK-8246666 | 13.0.4 | Aleksey Shipilev | P4 | Resolved | Fixed | b04 |
JDK-8239236 | 11.0.8-oracle | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
JDK-8239058 | 11.0.7 | Aleksey Shipilev | P4 | Resolved | Fixed | b04 |
Try this:
$ JAVA_OPTIONS="-XX:+CITime" ./ctw.sh test.jar
...and get no output. This is because internal tty shares the fd with System.out, which CTW runner closes on exit.
Bandaid fix:
diff -r 560b2becbe87 test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java
--- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java Thu Jan 30 12:00:38 2020 -0800
+++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java Fri Jan 31 23:08:18 2020 +0100
@@ -97,13 +97,15 @@
System.currentTimeMillis() - start));
passed = true;
} catch (Throwable t){
t.printStackTrace(ERR);
} finally {
- try {
- OUT.close();
- } catch (Throwable ignore) {
+ if (OUT != System.out) {
+ try {
+ OUT.close();
+ } catch (Throwable ignore) {
+ }
}
// <clinit> might have started new threads
System.exit(passed ? 0 : 1);
}
}
$ JAVA_OPTIONS="-XX:+CITime" ./ctw.sh test.jar
...and get no output. This is because internal tty shares the fd with System.out, which CTW runner closes on exit.
Bandaid fix:
diff -r 560b2becbe87 test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java
--- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java Thu Jan 30 12:00:38 2020 -0800
+++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java Fri Jan 31 23:08:18 2020 +0100
@@ -97,13 +97,15 @@
System.currentTimeMillis() - start));
passed = true;
} catch (Throwable t){
t.printStackTrace(ERR);
} finally {
- try {
- OUT.close();
- } catch (Throwable ignore) {
+ if (OUT != System.out) {
+ try {
+ OUT.close();
+ } catch (Throwable ignore) {
+ }
}
// <clinit> might have started new threads
System.exit(passed ? 0 : 1);
}
}
- backported by
-
JDK-8239058 CTW runner closes standard output on exit
-
- Resolved
-
-
JDK-8239236 CTW runner closes standard output on exit
-
- Resolved
-
-
JDK-8240763 CTW runner closes standard output on exit
-
- Resolved
-
-
JDK-8246666 CTW runner closes standard output on exit
-
- Resolved
-