<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Bengt,<br>
    <br>
    Thanks for looking again. A question inline...<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 3/25/2013 12:11 AM, Bengt Rutisson
      wrote:<br>
    </div>
    <blockquote cite="mid:514FF8AF.5010806@oracle.com" type="cite">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <div class="moz-cite-prefix"><br>
      </div>
      <blockquote cite="mid:514CA0C3.3080306@oracle.com" type="cite"><br>
        <blockquote cite="mid:514BFECC.8070206@oracle.com" type="cite">
          <div class="moz-cite-prefix"> <br>
            About the test. Great that you write a regression test for
            this! :)<br>
            <br>
            The @summary says that the test uses
            <meta http-equiv="content-type" content="text/html;
              charset=UTF-8">
            -XX:+VerifyDuringGC but the command line is actually using
            -XX:+VerifyBeforeGC (which is correct, I think). Also, would
            it make sense to have a separate test that specifies
            -XX:+UseG1GC and checks the output that we expect to see?<br>
          </div>
        </blockquote>
        <br>
        Yeah. Good catch. It should be with VerifyBeforeGC. Must have
        had marking on the brain.<br>
        <br>
        As for the test. I think we can check the output for
        "VerifyBefore"  for all the collectors. I'll change the test.<br>
      </blockquote>
      <br>
      Great!<br>
    </blockquote>
    <br>
    I may have spoken too soon. Using ProcessBuilder, is there any way
    to pass the GC flags to the spawned java process? The spawned
    process is not being passed any additional flags that are passed to
    jtreg. For example:<br>
    <br>
    <blockquote type="cite">/home/jcuthber/jtreg/jtreg/solaris/bin/jtreg
      \<br>
       -jdk:/java/re/jdk/8/latest/binaries/solaris-i586/fastdebug \<br>
       -vmoption:-XX:+UseG1GC \<br>
       gc/TestVerifyBeforeGCDuringStartup.java<br>
    </blockquote>
    <br>
    does not pass -XX:+UseG1GC to the java process spawned by the test:<br>
    <br>
    <blockquote type="cite">/* @test
      TestVerifyBeforeGCDuringStartup.java<br>
       * @key gc<br>
       * @bug 8010463<br>
       * @summary Simple test run with -XX:+VerifyBeforeGC -XX:-UseTLAB
      to verify 8010463<br>
       * @library /testlibrary<br>
       */<br>
      <br>
      import com.oracle.java.testlibrary.OutputAnalyzer;<br>
      import com.oracle.java.testlibrary.ProcessTools;<br>
      <br>
      public class TestVerifyBeforeGCDuringStartup {<br>
        public static void main(String args[]) throws Exception {<br>
          ProcessBuilder pb =<br>
            ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
      "-XX:-UseTLAB",<br>
                                                 
      "-XX:+UnlockDiagnosticVMOptions",<br>
                                                  "-XX:+VerifyBeforeGC",
      "-version");<br>
          OutputAnalyzer output = new OutputAnalyzer(pb.start());<br>
          output.shouldContain("[Verifying");<br>
          output.shouldHaveExitValue(0);<br>
        }<br>
      }</blockquote>
    <br>
    If I don't specify G1 in the argument list to ProcessBuilder, the
    test does not fail. <br>
    <br>
    <blockquote cite="mid:514FF8AF.5010806@oracle.com" type="cite">
      <blockquote cite="mid:514CA0C3.3080306@oracle.com" type="cite"> 2.
        Use (VerifyBeforeGC && VerifyGCStartAt == 0)<br>
      </blockquote>
      <br>
      Right. I would prefer 1. but I'm fine with 2. Maybe 2. is more
      reasonable change to do for this fix. Perhaps 1. should be its own
      change.<br>
    </blockquote>
    <br>
    I went with 2. I'll submit a new CR to use a new flag (and use a
    VMOperation).<br>
    <br>
    Thanks,<br>
    <br>
    JohnC<br>
  </body>
</html>