1 |
commit: 15f4b287d4e51821577b32f7f7d435d0e9030461 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 23 20:41:15 2020 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 23 20:41:47 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15f4b287 |
7 |
|
8 |
dev-java/openjdk: add patch to 11.0.7 to fix SIGSEGV in bootstrap |
9 |
|
10 |
Happens if bootstrap jvm was compiled with 11.0.7 (like -bin version) |
11 |
|
12 |
Bug: https://bugs.gentoo.org/719118 |
13 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
14 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
15 |
|
16 |
.../openjdk/files/openjdk-11.0.7_p10-sigsegv.patch | 55 ++++++++++++++++++++++ |
17 |
dev-java/openjdk/openjdk-11.0.7_p10.ebuild | 4 ++ |
18 |
2 files changed, 59 insertions(+) |
19 |
|
20 |
diff --git a/dev-java/openjdk/files/openjdk-11.0.7_p10-sigsegv.patch b/dev-java/openjdk/files/openjdk-11.0.7_p10-sigsegv.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..04c61c06589 |
23 |
--- /dev/null |
24 |
+++ b/dev-java/openjdk/files/openjdk-11.0.7_p10-sigsegv.patch |
25 |
@@ -0,0 +1,55 @@ |
26 |
+ |
27 |
+# HG changeset patch |
28 |
+# User ccheung |
29 |
+# Date 1564075552 25200 |
30 |
+# Node ID f1332f6025515e4fc9e42fbf79f983d782abaaf0 |
31 |
+# Parent 966fc6d784a737ec25cd0b1be48109a4a3fa02ad |
32 |
+8228407: JVM crashes with shared archive file mismatch |
33 |
+Summary: Stop processing other header fields if initial header check has failed. |
34 |
+Reviewed-by: dholmes, jiangli |
35 |
+ |
36 |
+diff -r 966fc6d784a7 -r f1332f602551 src/hotspot/share/memory/filemap.cpp |
37 |
+--- a/src/hotspot/share/memory/filemap.cpp Mon Mar 02 12:30:59 2020 +0100 |
38 |
++++ b/src/hotspot/share/memory/filemap.cpp Thu Jul 25 10:25:52 2019 -0700 |
39 |
+@@ -1287,7 +1287,9 @@ |
40 |
+ } |
41 |
+ |
42 |
+ init_from_file(_fd); |
43 |
+- if (!validate_header()) { |
44 |
++ // UseSharedSpaces could be disabled if the checking of some of the header fields in |
45 |
++ // init_from_file has failed. |
46 |
++ if (!UseSharedSpaces || !validate_header()) { |
47 |
+ return false; |
48 |
+ } |
49 |
+ return true; |
50 |
+diff -r 966fc6d784a7 -r f1332f602551 test/hotspot/jtreg/runtime/appcds/SharedArchiveConsistency.java |
51 |
+--- a/test/hotspot/jtreg/runtime/appcds/SharedArchiveConsistency.java Mon Mar 02 12:30:59 2020 +0100 |
52 |
++++ b/test/hotspot/jtreg/runtime/appcds/SharedArchiveConsistency.java Thu Jul 25 10:25:52 2019 -0700 |
53 |
+@@ -385,8 +385,16 @@ |
54 |
+ output.shouldNotContain("Checksum verification failed"); |
55 |
+ |
56 |
+ copyFile(orgJsaFile, jsa); |
57 |
++ // modify _jvm_ident and run with -Xshare:auto |
58 |
++ System.out.println("\n2b. Corrupt _jvm_ident run with -Xshare:auto\n"); |
59 |
++ modifyJvmIdent(); |
60 |
++ output = TestCommon.execAuto(execArgs); |
61 |
++ output.shouldContain("The shared archive file was created by a different version or build of HotSpot"); |
62 |
++ output.shouldContain("Hello World"); |
63 |
++ |
64 |
++ copyFile(orgJsaFile, jsa); |
65 |
+ // modify _magic and _paths_misc_info_size, test should fail |
66 |
+- System.out.println("\n2b. Corrupt _magic and _paths_misc_info_size, should fail\n"); |
67 |
++ System.out.println("\n2c. Corrupt _magic and _paths_misc_info_size, should fail\n"); |
68 |
+ modifyHeaderIntField(offset_magic, 0x00000000); |
69 |
+ modifyHeaderIntField(offset_paths_misc_info_size, Integer.MAX_VALUE); |
70 |
+ output = TestCommon.execCommon(execArgs); |
71 |
+@@ -395,7 +403,7 @@ |
72 |
+ |
73 |
+ copyFile(orgJsaFile, jsa); |
74 |
+ // modify _version and _paths_misc_info_size, test should fail |
75 |
+- System.out.println("\n2c. Corrupt _version and _paths_misc_info_size, should fail\n"); |
76 |
++ System.out.println("\n2d. Corrupt _version and _paths_misc_info_size, should fail\n"); |
77 |
+ modifyHeaderIntField(offset_version, 0x00000000); |
78 |
+ modifyHeaderIntField(offset_paths_misc_info_size, Integer.MAX_VALUE); |
79 |
+ output = TestCommon.execCommon(execArgs); |
80 |
+ |
81 |
|
82 |
diff --git a/dev-java/openjdk/openjdk-11.0.7_p10.ebuild b/dev-java/openjdk/openjdk-11.0.7_p10.ebuild |
83 |
index 9df2e6c723a..76d41a4eb08 100644 |
84 |
--- a/dev-java/openjdk/openjdk-11.0.7_p10.ebuild |
85 |
+++ b/dev-java/openjdk/openjdk-11.0.7_p10.ebuild |
86 |
@@ -77,6 +77,10 @@ REQUIRED_USE="javafx? ( alsa !headless-awt )" |
87 |
|
88 |
S="${WORKDIR}/jdk${SLOT}u-jdk-${MY_PV}" |
89 |
|
90 |
+PATCHES=( |
91 |
+ "${FILESDIR}/${P}-sigsegv.patch" |
92 |
+) |
93 |
+ |
94 |
# The space required to build varies wildly depending on USE flags, |
95 |
# ranging from 2GB to 16GB. This function is certainly not exact but |
96 |
# should be close enough to be useful. |