<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Chris, <br>
      <br>
      is it OK for me to send you a patch instead? Currently we are not
      calling this function during dump time and I don't want to commit
      any code that has not been tested.<br>
      <br>
      Harold,<br>
      <br>
      Thanks for the comment. I will modify it as you said.<br>
      <br>
      - Ioi<br>
      <br>
      <br>
      On 06/27/2013 09:02 AM, Christian Thalinger wrote:<br>
    </div>
    <blockquote
      cite="mid:6C52DC68-7024-496B-AE50-A6707D91DE19@oracle.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <br>
      <div>
        <div>On Jun 27, 2013, at 6:42 AM, harold seigel &lt;<a
            moz-do-not-send="true"
            href="mailto:harold.seigel@oracle.com">harold.seigel@oracle.com</a>&gt;
          wrote:</div>
        <br class="Apple-interchange-newline">
        <blockquote type="cite">
          <meta content="text/html; charset=ISO-8859-1"
            http-equiv="Content-Type">
          <div text="#000000" bgcolor="#FFFFFF"> Hi Ioi,<br>
            <br>
            The changes look good. <br>
            <br>
            You can simplify MetaspaceShared::is_in_shared_space(...) to
            something like:<br>
            <blockquote>// Return true if given address is in the mapped
              shared space.<br>
              bool MetaspaceShared::is_in_shared_space(const void* p) {<br>
              &nbsp; return UseSharedSpaces &amp;&amp;
              FileMapInfo::current_info()-&gt;is_in_shared_space(p);<br>
              }<br>
            </blockquote>
          </div>
        </blockquote>
        <div><br>
        </div>
        Would it be possible to change that method to also return a
        valid answer when dumping shared spaces? &nbsp;I'd need this for
        something else I'm working on.</div>
      <div><br>
      </div>
      <div>-- Chris<br>
        <blockquote type="cite">
          <div text="#000000" bgcolor="#FFFFFF">
            <blockquote> </blockquote>
            <br>
            Thanks, Harold<br>
            <br>
            <div class="moz-cite-prefix">On 6/27/2013 12:10 AM, Ioi Lam
              wrote:<br>
            </div>
            <blockquote cite="mid:51CBBB4A.70308@oracle.com" type="cite">
              <meta http-equiv="content-type" content="text/html;
                charset=ISO-8859-1">
              <code>Please review a small fix:</code><br>
              <div class="moz-forward-container"><code> </code><code><br>
                </code><code><tt>&nbsp;&nbsp;&nbsp; <a moz-do-not-send="true"
                      class="moz-txt-link-freetext"
href="http://cr.openjdk.java.net/%7Eiklam/8016075/cds_is_shared_crash_003/">http://cr.openjdk.java.net/~iklam/8016075/cds_is_shared_crash_003/</a></tt></code><code><br>
                </code><code><br>
                </code><code>Bug: Win32 crash with CDS enabled and small
                  heap size</code><code><br>
                </code><code><br>
                </code><code><tt>&nbsp;&nbsp;&nbsp; <a moz-do-not-send="true"
                      class="moz-txt-link-freetext"
                      href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8016075">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8016075</a></tt></code><code><br>
                </code><code><tt>&nbsp;&nbsp;&nbsp; <a moz-do-not-send="true"
                      class="moz-txt-link-freetext"
                      href="https://jbs.oracle.com/bugs/browse/JDK-8016075">https://jbs.oracle.com/bugs/browse/JDK-8016075</a></tt></code><code><br>
                </code><code><br>
                </code><code>Summary of fix:</code><code><br>
                </code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp; The function
                  MetaspaceShared::is_in_shared_space() was testing with</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp; incorrect bounds. As a resullt, a
                  dynamically loaded InstanceKlass</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp; was incorrectly identified as an
                  InstanceKlass stored in the CDS</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp; archive. This caused the following code
                  to fail:</code><code><br>
                </code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp; bool
                  InstanceKlass::link_class_impl(...) {</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!this_oop()-&gt;is_shared()) {</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ResourceMark rm(THREAD);</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  this_oop-&gt;vtable()-&gt;initialize_vtable(true,
                  CHECK_false); //&lt;&lt; failed to execute</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  this_oop-&gt;itable()-&gt;initialize_itable(true,
                  CHECK_false);</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</code><code><br>
                </code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp; Hence, Method::vtable_index() could
                  return an incorrect value for some</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp; Methods, leading to various mysterious
                  crashes.</code><code><br>
                </code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp; The fix is for
                  MetaspaceShared::is_in_shared_space() to consider the
                  actual used</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp; spaces in the CDS archive regions.</code><code><br>
                </code><code><br>
                </code><code>Tests:</code><code><br>
                </code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp; JPRT</code><code><br>
                </code><code>&nbsp;&nbsp;&nbsp; UTE (vm.runtime.testlist,
                  vm.quick.testlist, vm.parallel_class_loading.testlist)</code><code><br>
                </code><code><br>
                </code><code>Thanks</code><code><br>
                </code><code>- Ioi</code><code><br>
                </code><code><br>
                </code> <br>
              </div>
              <br>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
  </body>
</html>