< prev index next >

test/runtime/execstack/Testexecstack.java

Print this page




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  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 Testexecstack.java
  26  * @bug 7107135
  27  * @bug 8021296
  28  * @bug 8025519
  29  * @summary Stack guard pages lost after loading library with executable stack.
  30  * @requires (os.family == "linux")
  31  * @library /testlibrary
  32  * @build jdk.test.lib.*
  33  * @compile Test.java
  34  * @compile TestMT.java
  35  * @run driver Testexecstack
  36  */
  37 
  38 import jdk.test.lib.*;

  39 
  40 public class Testexecstack {
  41 
  42     public static void main(String[] args) throws Throwable {
  43 
  44         // Get the library path property
  45         String libpath = System.getProperty("java.library.path");
  46 
  47         // Create a new java process for the Test Java/JNI test without
  48         // an executeable stack
  49         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  50             "-Djava.library.path=" + libpath + ":.", "Test", "test-rw");
  51 
  52         // Start the process and check the output
  53         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  54         output.shouldHaveExitValue(0);
  55 
  56         // Create a new java process for the Test Java/JNI test with an
  57         // executable stack
  58         pb = ProcessTools.createJavaProcessBuilder(


  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  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 Testexecstack.java
  26  * @bug 7107135
  27  * @bug 8021296
  28  * @bug 8025519
  29  * @summary Stack guard pages lost after loading library with executable stack.
  30  * @requires (os.family == "linux")
  31  * @library /test/lib
  32  * @modules java.base/jdk.internal.misc 
  33  * @compile Test.java
  34  * @compile TestMT.java
  35  * @run driver Testexecstack
  36  */
  37 
  38 import jdk.test.lib.process.OutputAnalyzer;
  39 import jdk.test.lib.process.ProcessTools;
  40 
  41 public class Testexecstack {
  42 
  43     public static void main(String[] args) throws Throwable {
  44 
  45         // Get the library path property
  46         String libpath = System.getProperty("java.library.path");
  47 
  48         // Create a new java process for the Test Java/JNI test without
  49         // an executeable stack
  50         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  51             "-Djava.library.path=" + libpath + ":.", "Test", "test-rw");
  52 
  53         // Start the process and check the output
  54         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  55         output.shouldHaveExitValue(0);
  56 
  57         // Create a new java process for the Test Java/JNI test with an
  58         // executable stack
  59         pb = ProcessTools.createJavaProcessBuilder(
< prev index next >