< prev index next >

test/runtime/memory/ReadFromNoaccessArea.java

Print this page




  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @summary Test that touching noaccess area in class ReservedHeapSpace results in SIGSEGV/ACCESS_VIOLATION
  27  * @library /testlibrary /../../test/lib
  28  * @modules java.base/sun.misc
  29  *          java.management
  30  * @build ReadFromNoaccessArea
  31  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  32  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  33  * @run main ReadFromNoaccessArea
  34  */
  35 
  36 import com.oracle.java.testlibrary.*;
  37 import sun.hotspot.WhiteBox;
  38 
  39 public class ReadFromNoaccessArea {
  40 
  41   public static void main(String args[]) throws Exception {
  42     if (!Platform.is64bit()) {
  43       System.out.println("ReadFromNoaccessArea tests is useful only on 64bit architecture. Passing silently.");
  44       return;
  45     }
  46 
  47     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  48           "-Xbootclasspath/a:.",
  49           "-XX:+UnlockDiagnosticVMOptions",
  50           "-XX:+WhiteBoxAPI",
  51           "-XX:+UseCompressedOops",
  52           "-XX:HeapBaseMinAddress=33G",
  53           "-XX:-CreateCoredumpOnCrash",
  54           "-Xmx32m",
  55           DummyClassWithMainTryingToReadFromNoaccessArea.class.getName());
  56 




  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @summary Test that touching noaccess area in class ReservedHeapSpace results in SIGSEGV/ACCESS_VIOLATION
  27  * @library /testlibrary /../../test/lib
  28  * @modules java.base/sun.misc
  29  *          java.management
  30  * @build ReadFromNoaccessArea
  31  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  32  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  33  * @run main ReadFromNoaccessArea
  34  */
  35 
  36 import jdk.test.lib.*;
  37 import sun.hotspot.WhiteBox;
  38 
  39 public class ReadFromNoaccessArea {
  40 
  41   public static void main(String args[]) throws Exception {
  42     if (!Platform.is64bit()) {
  43       System.out.println("ReadFromNoaccessArea tests is useful only on 64bit architecture. Passing silently.");
  44       return;
  45     }
  46 
  47     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  48           "-Xbootclasspath/a:.",
  49           "-XX:+UnlockDiagnosticVMOptions",
  50           "-XX:+WhiteBoxAPI",
  51           "-XX:+UseCompressedOops",
  52           "-XX:HeapBaseMinAddress=33G",
  53           "-XX:-CreateCoredumpOnCrash",
  54           "-Xmx32m",
  55           DummyClassWithMainTryingToReadFromNoaccessArea.class.getName());
  56 


< prev index next >