<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Sounds like time to file a separate bug to track that issue down (particularly the bsd issue)<div>and move on with this one.</div><div><br></div><div>Thank you so much Dan for the history and details,</div><div>Karen</div><div><br><div><div>On Dec 19, 2012, at 11:30 AM, Daniel D. Daugherty wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
  
  <div bgcolor="#FFFFFF" text="#000000">
    <tt>Adding the other aliases back in...<br>
      <br>
      Harold,<br>
      <br>
      <tt>This question<tt>:<br>
          <br>
          <tt>&gt; Another nit: Is it worth checking that all of<br>
            <tt>&gt; </tt>"/hotspot/libjvm.so"<tt>&nbsp;</tt><tt></tt>could
            get copied to buf? (i.e.:&nbsp; that<br>
            <tt>&gt;</tt> buflen-len &gt; strlen("/hotspot/libjvm.so")<br>
            <br>
            <tt><tt>is straight forward and the short answer is<tt>:
                  yes, that<br>
                  <tt>code makes assumptions that "/hotspot/libjvm.so"
                    will<br>
                    <tt>fit in<tt>to 'buf'. It sho<tt>uld not do that.<br>
                          <br>
                          It is Ron's call<tt> </tt><tt>as to whether
                            he wants to fix this existing<br>
                            bug<tt> </tt>as part of this<tt> </tt><tt>work.
                              It is easy enough to fix the obvious<br>
                              <tt>part of the bug, but... as<tt> is
                                  normal with HotS<tt>pot, there<br>
                                    <tt>is more going on here than meets
                                      the eye...</tt><br>
                                  </tt></tt></tt></tt></tt></tt><br>
                        <tt>The slightly longer answer is that it pro<tt>bably
                            doesn't<br>
                            <tt>matter because the path being created
                              here is a fake.<br>
                              <tt>As long as the "<tt>/hotspot/l" part
                                  gets copied, then the<br>
                                  <tt>callers of os::jvm_path() will be
                                    able to handle the<br>
                                    <tt>fakery.</tt><br>
                                  </tt></tt></tt><br>
                              <tt>Of course, there is an even longer
                                answer. Read on if<br>
                                <tt>you want go<tt>ry details<tt> (and a
                                      history lesson).</tt></tt></tt><br>
                              </tt></tt></tt></tt></tt></tt></tt></tt><br>
              </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>This
                                          gamma launcher stuff is giving
                                          me an absolute headache.<br>
                                          <tt>Unfortunately, there is a
                                            lot of history involved
                                            here...</tt><br>
                                          <br>
                                          <tt>Here are the variations:<br>
                                            <br>
                                            src/os/bsd/vm/os_bsd.cpp:<br>
                                            <br>
                                            <tt>&nbsp;&nbsp; 1715&nbsp;&nbsp; if
                                              (Arguments::created_by_gamma_launcher())
                                              {<br>
                                              &nbsp;&nbsp; 1716&nbsp;&nbsp;&nbsp;&nbsp; // Support for
                                              the gamma launcher.&nbsp;
                                              Typical value for buf is<br>
                                              &nbsp;&nbsp; 1717&nbsp;&nbsp;&nbsp;&nbsp; //
                                              "&lt;JAVA_HOME&gt;/jre/lib/&lt;arch&gt;/&lt;vmtype&gt;/libjvm".&nbsp;
                                              If "/jre/lib/" appears at<br>
                                              &nbsp;&nbsp; 1718&nbsp;&nbsp;&nbsp;&nbsp; // the right
                                              place in the string, then
                                              assume we are installed in
                                              a JDK and<br>
                                              &nbsp;&nbsp; 1719&nbsp;&nbsp;&nbsp;&nbsp; // we're
                                              done.&nbsp; Otherwise, check
                                              for a JAVA_HOME
                                              environment variable and<br>
                                              &nbsp;&nbsp; 1720&nbsp;&nbsp;&nbsp;&nbsp; // construct a
                                              path to the JVM being
                                              overridden.<br>
                                            </tt><br>
                                            <tt>&lt;snip&gt;</tt><br>
                                            <br>
                                            <tt>&nbsp;&nbsp; 1762&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // If
                                              the path exists within
                                              JAVA_HOME, add the JVM
                                              library name<br>
                                              &nbsp;&nbsp; 1763&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // to
                                              complete the path to JVM
                                              being overridden.&nbsp;
                                              Otherwise fallback<br>
                                              &nbsp;&nbsp; 1764&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // to the
                                              path to the current
                                              library.<br>
                                              &nbsp;&nbsp; 1765&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (0 ==
                                              access(buf, F_OK)) {<br>
                                              &nbsp;&nbsp; 1766&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Use
                                              current module name
                                              "libjvm"<br>
                                              &nbsp;&nbsp; 1767&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; len =
                                              strlen(buf);<br>
                                              &nbsp;&nbsp; 1768&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                              snprintf(buf + len,
                                              buflen-len, "/libjvm%s",
                                              JNI_LIB_SUFFIX);<br>
                                              &nbsp;&nbsp; 1769&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<br>
                                              &nbsp;&nbsp; 1770&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Fall
                                              back to path of current
                                              library<br>
                                              &nbsp;&nbsp; 1771&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rp =
                                              realpath(dli_fname, buf);<br>
                                              &nbsp;&nbsp; 1772&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (rp
                                              == NULL)<br>
                                              &nbsp;&nbsp; 1773&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                              return;<br>
                                              &nbsp;&nbsp; 1774&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                                            </tt><br>
                                          </tt>src/os/linux/vm/os_linux.cpp:<br>
                                          <br>
                                          <tt>&nbsp;&nbsp; 2206&nbsp;&nbsp; if
                                            (Arguments::created_by_gamma_launcher())
                                            {<br>
                                            &nbsp;&nbsp; 2207&nbsp;&nbsp;&nbsp;&nbsp; // Support for
                                            the gamma launcher.&nbsp; Typical
                                            value for buf is<br>
                                            &nbsp;&nbsp; 2208&nbsp;&nbsp;&nbsp;&nbsp; //
                                            "&lt;JAVA_HOME&gt;/jre/lib/&lt;arch&gt;/&lt;vmtype&gt;/libjvm.so".&nbsp;
                                            If "/jre/lib/" appears at<br>
                                            &nbsp;&nbsp; 2209&nbsp;&nbsp;&nbsp;&nbsp; // the right
                                            place in the string, then
                                            assume we are installed in a
                                            JDK and<br>
                                            &nbsp;&nbsp; 2210&nbsp;&nbsp;&nbsp;&nbsp; // we're done.&nbsp;
                                            Otherwise, check for a
                                            JAVA_HOME environment
                                            variable and fix&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
                                            &nbsp;&nbsp; 2211&nbsp;&nbsp;&nbsp;&nbsp; // up the path
                                            so it looks like libjvm.so
                                            is installed there (append a<br>
                                            &nbsp;&nbsp; 2212&nbsp;&nbsp;&nbsp;&nbsp; // fake suffix
                                            hotspot/libjvm.so).<br>
                                            <br>
                                            <tt>&lt;snip&gt;<br>
                                              <br>
                                            </tt></tt><tt>&nbsp;&nbsp;
                                            2243&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (0 ==
                                            access(buf, F_OK)) {<br>
                                            &nbsp;&nbsp; 2244&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Use
                                            current module name
                                            "libjvm.so"<br>
                                            &nbsp;&nbsp; 2245&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; len =
                                            strlen(buf);<br>
                                            &nbsp;&nbsp; 2246&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            snprintf(buf + len,
                                            buflen-len,
                                            "/hotspot/libjvm.so");<br>
                                            &nbsp;&nbsp; 2247&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<br>
                                            &nbsp;&nbsp; 2248&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Go back
                                            to path of .so<br>
                                            &nbsp;&nbsp; 2249&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rp =
                                            realpath(dli_fname, buf);<br>
                                            &nbsp;&nbsp; 2250&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (rp ==
                                            NULL)<br>
                                            &nbsp;&nbsp; 2251&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br>
                                            &nbsp;&nbsp; 2252&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                                          </tt><br>
                                        </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>src/os/solaris/vm/os_solaris.cpp:<br>
                  <br>
                  &nbsp;&nbsp; 2496&nbsp;&nbsp; if (Arguments::created_by_gamma_launcher())
                  {<br>
                  &nbsp;&nbsp; 2497&nbsp;&nbsp;&nbsp;&nbsp; // Support for the gamma launcher.&nbsp;
                  Typical value for buf is<br>
                  &nbsp;&nbsp; 2498&nbsp;&nbsp;&nbsp;&nbsp; //
                  "&lt;JAVA_HOME&gt;/jre/lib/&lt;arch&gt;/&lt;vmtype&gt;/libjvm.so".&nbsp;
                  If "/jre/lib/" appears at<br>
                  &nbsp;&nbsp; 2499&nbsp;&nbsp;&nbsp;&nbsp; // the right place in the string, then
                  assume we are installed in a JDK and<br>
                  &nbsp;&nbsp; 2500&nbsp;&nbsp;&nbsp;&nbsp; // we're done.&nbsp; Otherwise, check for a
                  JAVA_HOME environment variable and fix<br>
                  &nbsp;&nbsp; 2501&nbsp;&nbsp;&nbsp;&nbsp; // up the path so it looks like libjvm.so
                  is installed there (append a<br>
                  &nbsp;&nbsp; 2502&nbsp;&nbsp;&nbsp;&nbsp; // fake suffix hotspot/libjvm.so).<br>
                  <br>
                  <tt>&lt;snip&gt;<br>
                    <br>
                  </tt><tt>&nbsp;&nbsp; 2539&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (0 == access(buf, F_OK)) {<br>
                    &nbsp;&nbsp; 2540&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Use current module name
                    "libjvm.so"<br>
                    &nbsp;&nbsp; 2541&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; len = strlen(buf);<br>
                    &nbsp;&nbsp; 2542&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; snprintf(buf + len, buflen-len,
                    "/hotspot/libjvm.so");<br>
                    &nbsp;&nbsp; 2543&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<br>
                    &nbsp;&nbsp; 2544&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Go back to path of .so<br>
                    &nbsp;&nbsp; 2545&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; realpath((char *)dlinfo.dli_fname,
                    buf);<br>
                    &nbsp;&nbsp; 2546&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                  </tt><br>
                  <tt>src/os/windows/vm/os_windows.cpp<tt>:<br>
                      <br>
                      <tt>&nbsp;&nbsp; 1732&nbsp;&nbsp; buf[0] = '\0';<br>
                        &nbsp;&nbsp; 1733&nbsp;&nbsp; if
                        (Arguments::created_by_gamma_launcher()) {<br>
                        &nbsp;&nbsp; 1734&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Support for the gamma launcher.
                        Check for an<br>
                        &nbsp;&nbsp; 1735&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // JAVA_HOME environment variable<br>
                        &nbsp;&nbsp; 1736&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // and fix up the path so it looks
                        like<br>
                        &nbsp;&nbsp; 1737&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // libjvm.so is installed there
                        (append a fake suffix<br>
                        &nbsp;&nbsp; 1738&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // hotspot/libjvm.so).<br>
                        &nbsp;&nbsp; 1739&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char* java_home_var =
                        ::getenv("JAVA_HOME");<br>
                        &nbsp;&nbsp; 1740&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (java_home_var != NULL
                        &amp;&amp; java_home_var[0] != 0) {<br>
                        &nbsp;&nbsp; 1741 <br>
                        &nbsp;&nbsp; 1742&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strncpy(buf, java_home_var,
                        buflen);<br>
                        &nbsp;&nbsp; 1743 <br>
                        &nbsp;&nbsp; 1744&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // determine if this is a legacy
                        image or modules image<br>
                        &nbsp;&nbsp; 1745&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // modules image doesn't have
                        "jre" subdirectory<br>
                        &nbsp;&nbsp; 1746&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size_t len = strlen(buf);<br>
                        &nbsp;&nbsp; 1747&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char* jrebin_p = buf + len;<br>
                        &nbsp;&nbsp; 1748&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jio_snprintf(jrebin_p,
                        buflen-len, "<a href="smb://jre//bin//">\\jre\\bin\\</a>");<br>
                        &nbsp;&nbsp; 1749&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (0 != _access(buf, 0)) {<br>
                        &nbsp;&nbsp; 1750&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jio_snprintf(jrebin_p,
                        buflen-len, "<a href="smb://bin//">\\bin\\</a>");<br>
                        &nbsp;&nbsp; 1751&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                        &nbsp;&nbsp; 1752&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; len = strlen(buf);<br>
                        &nbsp;&nbsp; 1753&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jio_snprintf(buf + len,
                        buflen-len, "hotspot\\jvm.dll");<br>
                        &nbsp;&nbsp; 1754&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                        &nbsp;&nbsp; 1755&nbsp;&nbsp; }<br>
                      </tt><br>
                      <br>
                      <tt>Linux, Solaris and Windows all recog<tt>nize
                          that if they<br>
                          <tt>get to <tt>the point where they are
                              appending a "hotspot/..."<br>
                              <tt>path to the jvm_path value, the<tt>n
                                  they are mak<tt>ing a fake<br>
                                    <tt>path. Why are they making a fake
                                      path? Well, the gamma<br>
                                      <tt>la<tt>uncher let<tt>s <tt>someone
                                              use a libjvm.so/jvm.dll <tt>that
                                                is<br>
                                                <tt>not located in the
                                                  usual place in a JDK.
                                                  And, you get<br>
                                                  <tt>to use that
                                                    libjvm.so/jvm.dll <tt>WITH
                                                      THAT JDK. <tt>Sounds<br>
                                                        <tt>pretty cool<tt>
                                                          and it is
                                                          pretty cool...
                                                          <tt>u</tt>ntil
                                                          you realize<br>
                                                          <tt>that there
                                                          is code in the
                                                          VM that tries
                                                          to find other<br>
                                                          <tt>libraries
                                                          _relative_ to
                                                          the
                                                          libjvm.so/jvm.dll
                                                          that is<br>
                                                          <tt>running.
                                                          Ouch! So enter
                                                          the above code<tt>
                                                          blocks that
                                                          fake<br>
                                                          <tt>a path to
                                                          the <tt>libjvm.so/jvm.dll
                                                          so that
                                                          callers to<br>
                                                          <tt>os::jvm_path()
                                                          don't get
                                                          confused.<br>
                                                          <br>
                                                          <tt>To make
                                                          matters more
                                                          conv<tt>oluted...
                                                          yes, I <tt>know
                                                          this is<br>
                                                          <tt>convoluted
                                                          <tt>enough...
                                                          The <tt>os_bsd.cpp
                                                          doesn't seem
                                                          to<br>
                                                          <tt>realize
                                                          that it is
                                                          creating a
                                                          fake path <tt>here.
                                                          At one<br>
                                                          <tt>point, the
                                                          os_bs<tt>d.<tt>cpp
                                                          code was a
                                                          copy of
                                                          os_linux.cpp<br>
                                                          <tt>code<tt>,
                                                          but it was ob<tt>viously
                                                          tweaked. It
                                                          will take more<br>
                                                          <tt>investigation
                                                          to figure out
                                                          the right
                                                          course of
                                                          action<br>
                                                          <tt>for
                                                          os_bsd.cpp<br>
                                                          <br>
                                                          <tt><tt>Dan<br>
                                                          <br>
                                                          </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
          <br>
        </tt></tt></tt>On 12/19/12 7:51 AM, harold seigel wrote:<br>
    <blockquote cite="mid:50D1D461.50109@oracle.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
      Hi Ron,<br>
      <br>
      I'm ok with using snprinft().<br>
      <br>
      Another nit: Is it worth checking that all of "/hotspot/libjvm.so"
      could get copied to buf?&nbsp; (i.e.:&nbsp; that buflen-len &gt;
      strlen("/hotspot/libjvm.so")<br>
      <br>
      Thanks, Harold<br>
      <br>
      On 12/19/2012 9:17 AM, Ron Durbin wrote:
      <blockquote cite="mid:955b2245-7480-4af0-bd88-16eb1dd5856a@default" type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=ISO-8859-1">
        <meta name="Generator" content="Microsoft Word 12 (filtered
          medium)">
        <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
span.changed
        {mso-style-name:changed;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle25
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle26
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle27
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
        <div class="WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Harold,<o:p></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Did

              you have any more points or counter points to make on the
              use of snprintf and strncpy ?<o:p></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Ron<o:p></o:p></span></p>
          <div>
            <div style="border:none;border-top:solid #B5C4DF
              1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">
                  Ron Durbin <br>
                  <b>Sent:</b> Tuesday, December 18, 2012 4:50 PM<br>
                  <b>To:</b> Daniel Daugherty; <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:hotspot-runtime-dev@openjdk.java.net">hotspot-runtime-dev@openjdk.java.net</a>;
                  build-dev; <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:serviceability-dev@openjdk.java.net">serviceability-dev@openjdk.java.net</a><br>
                  <b>Subject:</b> RE: Code Review fix for 8005044 remove
                  crufty '_g' support from HS runtime code<o:p></o:p></span></p>
            </div>
          </div><p class="MsoNormal"><o:p>&nbsp;</o:p></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Thanks

              for the quick reviews by all.<o:p></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I
              will agree with Dan on this one, sprint will stay.<o:p></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Ron<o:p></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
          <div>
            <div style="border:none;border-top:solid #B5C4DF
              1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">
                  Daniel D. Daugherty <br>
                  <b>Sent:</b> Tuesday, December 18, 2012 4:03 PM<br>
                  <b>To:</b> <a moz-do-not-send="true" href="mailto:hotspot-runtime-dev@openjdk.java.net">hotspot-runtime-dev@openjdk.java.net</a>;
                  build-dev; <a moz-do-not-send="true" href="mailto:serviceability-dev@openjdk.java.net">serviceability-dev@openjdk.java.net</a><br>
                  <b>Subject:</b> Re: Code Review fix for 8005044 remove
                  crufty '_g' support from HS runtime code<o:p></o:p></span></p>
            </div>
          </div><p class="MsoNormal"><o:p>&nbsp;</o:p></p><p class="MsoNormal" style="margin-bottom:12.0pt"><tt><span style="font-size:10.0pt">Sorry, I lost my manners
                somewhere... :-(</span></tt><span style="font-size:10.0pt;font-family:&quot;Courier
              New&quot;"><br>
              <br>
              <tt>Thanks for the fast review!</tt><br>
              <br>
              <tt>Dan</tt></span><o:p></o:p></p>
          <div><p class="MsoNormal">On 12/18/12 3:57 PM, Daniel D.
              Daugherty wrote:<o:p></o:p></p>
          </div>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><p class="MsoNormal" style="margin-bottom:12.0pt"><tt><span style="font-size:10.0pt">Adding back in the other
                  aliases...</span></tt><span style="font-size:10.0pt;font-family:&quot;Courier
                New&quot;"><br>
                <br>
                <tt>Harold,</tt><br>
                <br>
                <tt>The equivalent of:</tt><br>
                <br>
                <tt>&nbsp;&nbsp;&nbsp; snprintf(buf, n, str);</tt><br>
                <br>
                <tt>is:</tt><br>
                <br>
                <tt>&nbsp;&nbsp;&nbsp; strncpy(buf, str, n - 1);</tt><br>
                <tt>&nbsp;&nbsp;&nbsp; buf[n - 1] = '\0';</tt><br>
                <br>
                <tt>because snprintf() will only write out (n - 1) bytes
                  from</tt><br>
                <tt>'str' to 'buf' and then write a NUL in the last
                  slot.</tt><br>
                <tt>strncpy() copies up to 'n' bytes from 'str' to
                  'buf'.</tt><br>
                <tt>strncpy() will not copy past a NUL character in
                  'str', but</tt><br>
                <tt>it will also not NUL terminate 'buf' if a NUL is not
                  found</tt><br>
                <tt>in 'str' before the limit 'n' is reached.</tt><br>
                <br>
                <tt>Dan</tt></span><o:p></o:p></p>
            <div><p class="MsoNormal">On 12/18/12 2:48 PM, harold seigel
                wrote:<o:p></o:p></p>
            </div>
            <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><p class="MsoNormal">Hi Ron,<br>
                <br>
                I think these calls to snprintf() in os_solaris.cpp and
                the other os_....cpp files could be replaced with calls
                to strncpy().&nbsp; It might be a little simpler.<br>
                <br>
                Otherwise, it looks good.<br>
                <br>
                Thanks, Harold<br>
                <br>
                2539 if (0 == access(buf, F_OK)) { <br>
                <span class="changed">2540 // Use current module name
                  "libjvm.so"</span> <br>
                2541 len = strlen(buf); <br>
                <span class="changed">2542 <b>snprintf(buf + len,
                    buflen-len, "/hotspot/libjvm.so");</b></span> <br>
                2543 } else { <br>
                2544 // Go back to path of .so <br>
                2545 realpath((char *)dlinfo.dli_fname, buf); 2546 } <br>
                <br>
                On 12/18/2012 3:46 PM, Daniel D. Daugherty wrote: <o:p></o:p></p><p class="MsoNormal" style="margin-bottom:12.0pt"><tt><span style="font-size:11.0pt">Greetings,</span></tt><span style="font-size:11.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                  <br>
                </span><tt><span style="font-size:10.0pt">I'm sponsoring
                    this code review request from Ron Durbin. This
                    change</span></tt><span style="font-size:11.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                </span><tt><span style="font-size:10.0pt">is targeted at
                    JDK8/HSX-25 in the RT_Baseline repo.</span></tt><span style="font-size:11.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                  <br>
                </span><tt><span style="font-size:10.0pt">Dan</span></tt><span style="font-size:11.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                  <br>
                </span><tt><span style="font-size:10.0pt">Sending again
                    with correct subject line, bug URLs and webrev URL.</span></tt><span style="font-size:11.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                  <br>
                </span><span style="font-size:10.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                  <tt>Intro:</tt><br>
                  <tt>&nbsp;</tt><br>
                  <tt>This set of changes removes the runtime support
                    for generation of debug versions that follow _g
                    semantics.</tt><br>
                  <tt>&nbsp;</tt><br>
                  <tt>Defect:</tt><br>
                </span><tt><span style="font-size:9.0pt">JDK-8005044
                    remove crufty '_g' support from HS runtime code</span></tt><span style="font-size:10.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                  <tt><a moz-do-not-send="true" href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8005044">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8005044</a></tt><br>
                  <tt><a moz-do-not-send="true" href="https://jbs.oracle.com/bugs/browse/JDK-8005044">https://jbs.oracle.com/bugs/browse/JDK-8005044</a></tt><br>
                  <br>
                  <br>
                  <tt>Webrev</tt><br>
                  <tt><a moz-do-not-send="true" href="http://cr.openjdk.java.net/%7Edcubed/for_rdurbin/8005044-webrev/0">http://cr.openjdk.java.net/~dcubed/for_rdurbin/8005044-webrev/0</a>
                  </tt><br>
                  <br>
                  <tt>&nbsp;</tt><br>
                  <tt>Details:</tt><br>
                </span><tt><span style="font-size:11.0pt">Files </span></tt><tt><span style="font-size:10.0pt">have been modified to
                    remove all reference and support for &nbsp;debug versions
                    that follow _g semantics.</span></tt><span style="font-size:10.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                </span><tt><span style="font-size:11.0pt">&nbsp;</span></tt><span style="font-size:10.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                </span><tt><span style="font-size:11.0pt">Testing:</span></tt><span style="font-size:10.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                </span><tt><span style="font-size:11.0pt">&nbsp;</span></tt><span style="font-size:10.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                </span><tt><span style="font-size:11.0pt">Passed JPRT
                    last night:</span></tt><span style="font-size:10.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                </span><tt><span style="font-size:11.0pt">&nbsp;</span></tt><span style="font-size:10.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                </span><tt><span style="font-size:11.0pt">Additional
                    Testing In process: (suggested by Dan)</span></tt><tt><span style="font-size:10.0pt">:</span></tt><span style="font-size:10.0pt;font-family:&quot;Courier
                  New&quot;"><br>
                  <br>
                  <tt>src/share/vm/runtime/arguments.cpp</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp; - test with shared archive creation and use;
                    see the e-mail</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from Coleen</tt><br>
                  <br>
                  <tt>src/share/tools/ProjectCreator/ProjectCreator.java</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp; - just a usage message; visual inspection of
                    the code</tt><br>
                  <br>
                  <tt>src/os/windows/vm/os_windows.cpp</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp; - comments only; no testing needed</tt><br>
                  <br>
                  <tt>src/os/{bsd,linux,solaris}/vm/os_{bsd,linux,solaris}.cpp</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp; - the only code changes come into play when
                    the "gamma"</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; launcher is used</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp; - and when JAVA_HOME refers to a valid JDK,
                    the function</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fakes up a JVM path so that callers using
                    the JVM path</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to find other things in the JDK will work.</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp; - I can't find any way that the actual JVM
                    path value</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; that is returned is exposed</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp; - I don't see a way to test this other than
                    have a debug</tt><br>
                  <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf() or manual code inspection.</tt></span><o:p></o:p></p>
            </blockquote><p class="MsoNormal"><o:p>&nbsp;</o:p></p>
          </blockquote><p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        </div>
      </blockquote>
    </blockquote>
    <br>
  </div>

</blockquote></div><br></div></body></html>