summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErkka Kääriä <erkka.kaaria@intel.com>2015-10-23 12:50:01 +0300
committerMaxin B. John <maxin.john@intel.com>2015-10-23 13:05:09 +0300
commitafe248093ae780a83af08e658c8ab306a7eb5f6a (patch)
tree130c599b521fb46af0344f1edebd7cc4c20a782c
parentd7d4f64a32d26fc8a92e4c89b47c78956f20a14d (diff)
downloadmeta-java-afe248093ae780a83af08e658c8ab306a7eb5f6a.tar.gz
icedtea7-native: Fix memory leak when compiled with GCC 5.0+
Hotspot compiler has a bug where signed integers could overflow. This is undefined behaviour, and causes massive memory leak when compiled with GCC 5.0+, causing the build to fail. This is fixed by backporting patch from https://bugs.openjdk.java.net/browse/JDK-8078666 where it was fixed by Severin Gehwolf. Signed-off-by: Erkka Kääriä <erkka.kaaria@intel.com> Signed-off-by: Maxin B. John <maxin.john@intel.com>
-rw-r--r--recipes-core/icedtea/openjdk-7-03b147/icedtea-hotspot-fix-undefined-behaviour.patch49
-rw-r--r--recipes-core/icedtea/openjdk-7-release-03b147.inc2
2 files changed, 51 insertions, 0 deletions
diff --git a/recipes-core/icedtea/openjdk-7-03b147/icedtea-hotspot-fix-undefined-behaviour.patch b/recipes-core/icedtea/openjdk-7-03b147/icedtea-hotspot-fix-undefined-behaviour.patch
new file mode 100644
index 0000000..56513a0
--- /dev/null
+++ b/recipes-core/icedtea/openjdk-7-03b147/icedtea-hotspot-fix-undefined-behaviour.patch
@@ -0,0 +1,49 @@
1Upstream-Status: Backport
2
3Hotspot compiler has a bug where signed integers could overflow. This is
4undefined behaviour, and causes massive memory leak when compiled with GCC 5.0+,
5causing the build to fail.
6
7This is fixed by backporting patch from
8https://bugs.openjdk.java.net/browse/JDK-8078666 where it was fixed by
9Severin Gehwolf.
10
11Signed-off-by: Erkka Kääriä <erkka.kaaria@intel.com>
12
13--- openjdk/hotspot/src/share/vm/opto/type.cpp
14+++ openjdk/hotspot/src/share/vm/opto/type.cpp
15@@ -1077,11 +1077,11 @@ static int normalize_int_widen( jint lo, jint hi, int w ) {
16 // Certain normalizations keep us sane when comparing types.
17 // The 'SMALLINT' covers constants and also CC and its relatives.
18 if (lo <= hi) {
19- if ((juint)(hi - lo) <= SMALLINT) w = Type::WidenMin;
20- if ((juint)(hi - lo) >= max_juint) w = Type::WidenMax; // TypeInt::INT
21+ if (((juint)hi - lo) <= SMALLINT) w = Type::WidenMin;
22+ if (((juint)hi - lo) >= max_juint) w = Type::WidenMax; // TypeInt::INT
23 } else {
24- if ((juint)(lo - hi) <= SMALLINT) w = Type::WidenMin;
25- if ((juint)(lo - hi) >= max_juint) w = Type::WidenMin; // dual TypeInt::INT
26+ if (((juint)lo - hi) <= SMALLINT) w = Type::WidenMin;
27+ if (((juint)lo - hi) >= max_juint) w = Type::WidenMin; // dual TypeInt::INT
28 }
29 return w;
30 }
31@@ -1332,11 +1332,11 @@ static int normalize_long_widen( jlong lo, jlong hi, int w ) {
32 // Certain normalizations keep us sane when comparing types.
33 // The 'SMALLINT' covers constants.
34 if (lo <= hi) {
35- if ((julong)(hi - lo) <= SMALLINT) w = Type::WidenMin;
36- if ((julong)(hi - lo) >= max_julong) w = Type::WidenMax; // TypeLong::LONG
37+ if (((julong)hi - lo) <= SMALLINT) w = Type::WidenMin;
38+ if (((julong)hi - lo) >= max_julong) w = Type::WidenMax; // TypeLong::LONG
39 } else {
40- if ((julong)(lo - hi) <= SMALLINT) w = Type::WidenMin;
41- if ((julong)(lo - hi) >= max_julong) w = Type::WidenMin; // dual TypeLong::LONG
42+ if (((julong)lo - hi) <= SMALLINT) w = Type::WidenMin;
43+ if (((julong)lo - hi) >= max_julong) w = Type::WidenMin; // dual TypeLong::LONG
44 }
45 return w;
46 }
47--
482.1.4
49
diff --git a/recipes-core/icedtea/openjdk-7-release-03b147.inc b/recipes-core/icedtea/openjdk-7-release-03b147.inc
index 98266f7..b1cf6e9 100644
--- a/recipes-core/icedtea/openjdk-7-release-03b147.inc
+++ b/recipes-core/icedtea/openjdk-7-release-03b147.inc
@@ -84,6 +84,7 @@ OPENJDK_PATCHES = " \
84 file://icedtea-change-to-gdb-debug-format.patch;apply=no \ 84 file://icedtea-change-to-gdb-debug-format.patch;apply=no \
85 file://icedtea-disable-x11-in-headless.patch;apply=no \ 85 file://icedtea-disable-x11-in-headless.patch;apply=no \
86 file://icedtea-disable-sun.applet-for-tools-in-headless.patch;apply=no \ 86 file://icedtea-disable-sun.applet-for-tools-in-headless.patch;apply=no \
87 file://icedtea-hotspot-fix-undefined-behaviour.patch;apply=no \
87 " 88 "
88 89
89OPENJDK_HEADLESS_PATCHES = " \ 90OPENJDK_HEADLESS_PATCHES = " \
@@ -102,5 +103,6 @@ export DISTRIBUTION_PATCHES = " \
102 patches/icedtea-flags.patch \ 103 patches/icedtea-flags.patch \
103 patches/icedtea-openjdk-remove-currency-data-generation-expi.patch \ 104 patches/icedtea-openjdk-remove-currency-data-generation-expi.patch \
104 patches/icedtea-change-to-gdb-debug-format.patch \ 105 patches/icedtea-change-to-gdb-debug-format.patch \
106 patches/icedtea-hotspot-fix-undefined-behaviour.patch \
105 ${CLEAN_X11_DISTRIBUTION_PATCH} \ 107 ${CLEAN_X11_DISTRIBUTION_PATCH} \
106 " 108 "