Skip to content

Commit 89d73c2

Browse files
asgibbonsDerek White
authored andcommitted
8273108: RunThese24H crashes with SEGV in markWord::displaced_mark_helper() after JDK-8268276
8272809: JFR thread sampler SI_KERNEL SEGV in metaspace::VirtualSpaceList::contains Backport-of: 9a1bbaf8db0e869ab76be8ab1bd0ddeb23693e7e
1 parent 3c750d2 commit 89d73c2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import java.util.Base64.Encoder;
4949
import java.util.Objects;
5050
import java.util.Random;
51+
import java.util.Arrays;
5152

5253
import compiler.whitebox.CompilerWhiteBoxTest;
5354
import sun.hotspot.code.Compiler;
@@ -79,9 +80,9 @@ public static void main(String[] args) throws Exception {
7980

8081
private static void warmup() {
8182
final int warmupCount = 20_000;
82-
final int bufSize = 60;
83+
final int bufSize = 15308;
8384
byte[] srcBuf = new byte[bufSize];
84-
byte[] encBuf = new byte[(bufSize / 3) * 4];
85+
byte[] encBuf = new byte[((bufSize + 2) / 3) * 4];
8586
byte[] decBuf = new byte[bufSize];
8687

8788
ran.nextBytes(srcBuf);
@@ -163,10 +164,13 @@ public static void test0(FileType inputFileType, Base64Type type, Encoder encode
163164
assertEqual(resEncodeStr, encodedStr);
164165

165166
// test int decode(byte[], byte[])
166-
resArr = new byte[srcArr.length];
167+
// JDK-8273108: Test for output buffer overrun
168+
resArr = new byte[srcArr.length + 2];
169+
resArr[srcArr.length + 1] = (byte) 167;
167170
len = decoder.decode(encodedArr, resArr);
168171
assertEqual(len, srcArr.length);
169-
assertEqual(resArr, srcArr);
172+
assertEqual(Arrays.copyOfRange(resArr, 0, srcArr.length), srcArr);
173+
assertEqual(resArr[srcArr.length + 1], (byte) 167);
170174

171175
// test byte[] decode(byte[])
172176
resArr = decoder.decode(encodedArr);

0 commit comments

Comments
 (0)