<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><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]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Harold,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";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:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";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:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Ron Durbin <br><b>Sent:</b> Tuesday, December 18, 2012 4:50 PM<br><b>To:</b> Daniel Daugherty; hotspot-runtime-dev@openjdk.java.net; build-dev; serviceability-dev@openjdk.java.net<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:"Calibri","sans-serif";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:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";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:"Calibri","sans-serif";color:#1F497D'>Ron<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";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:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Daniel D. Daugherty <br><b>Sent:</b> Tuesday, December 18, 2012 4:03 PM<br><b>To:</b> <a href="mailto:hotspot-runtime-dev@openjdk.java.net">hotspot-runtime-dev@openjdk.java.net</a>; build-dev; <a 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:"Courier New"'><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:"Courier New"'><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 &quot;libjvm.so&quot;</span> <br>2541 len = strlen(buf); <br><span class=changed>2542 <b>snprintf(buf + len, buflen-len, &quot;/hotspot/libjvm.so&quot;);</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:"Courier New"'><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:"Courier New"'><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:"Courier New"'><br><br></span><tt><span style='font-size:10.0pt'>Dan</span></tt><span style='font-size:11.0pt;font-family:"Courier New"'><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:"Courier New"'><br><br></span><span style='font-size:10.0pt;font-family:"Courier New"'><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:"Courier New"'><br><tt><a 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 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 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:"Courier New"'><br></span><tt><span style='font-size:11.0pt'>&nbsp;</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br></span><tt><span style='font-size:11.0pt'>Testing:</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br></span><tt><span style='font-size:11.0pt'>&nbsp;</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br></span><tt><span style='font-size:11.0pt'>Passed JPRT last night:</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br></span><tt><span style='font-size:11.0pt'>&nbsp;</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><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:"Courier New"'><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 &quot;gamma&quot;</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></body></html>