4534N/A * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 4534N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4534N/A * This code is free software; you can redistribute it and/or modify it 4534N/A * under the terms of the GNU General Public License version 2 only, as 4534N/A * published by the Free Software Foundation. 4534N/A * This code is distributed in the hope that it will be useful, but WITHOUT 4534N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 4534N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 4534N/A * version 2 for more details (a copy is included in the LICENSE file that 4534N/A * You should have received a copy of the GNU General Public License version 4534N/A * 2 along with this work; if not, write to the Free Software Foundation, 4534N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 4534N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4534N/A * or visit www.oracle.com if you need additional information or have any 4534N/A * @summary Kitchensink crashed with SIGSEGV, Problematic frame: v ~StubRoutines::checkcast_arraycopy 4534N/A * @run main ClassFileInstaller sun.hotspot.WhiteBox 4534N/A * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. -Xmx64m -XX:NewSize=20971520 -XX:MaxNewSize=32m -XX:-UseTLAB -XX:-UseParNewGC -XX:-UseAdaptiveSizePolicy Test8010927 4534N/A * The test creates uncommitted space between oldgen and young gen 4534N/A * by specifying MaxNewSize bigger than NewSize. 4534N/A * NewSize = 20971520 = (512*4K) * 10 for 4k pages 4534N/A * Then it tries to execute arraycopy() with elements type check 4534N/A * to the array at the end of survive space near unused space. 4534N/A // 2 different obect arrays but same element types 4534N/A // The size is big to not fit into survive space. 4534N/A // Move cache[] to the old gen. 4534N/A // OldGen is placed before youngger for ParallelOldGC. 4534N/A // Each A[one_card] size is 512 bytes, 4534N/A // it will take about 40000 allocations to trigger GC. 4534N/A // cache[] has 8192 elements so GC should happen 4534N/A for(
long l =
0; l <
20; l++) {
4534N/A // Execute arraycopy to the topmost array in young gen 4534N/A for (
long j =
0; j <
256; ++j) {