[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-serviceability-dev
Subject: RE: RFR [XS]: 8230901: missing ReleaseStringUTFChars in servicability native code
From: "Baesken, Matthias" <matthias.baesken () sap ! com>
Date: 2019-09-17 11:07:43
Message-ID: AM6PR02MB507837E20524B416E2711389938F0 () AM6PR02MB5078 ! eurprd02 ! prod ! outlook ! com
[Download RAW message or body]
[Attachment #2 (text/plain)]
Hi Serguei and Thomas , thanks for the reviews.
> Should I open a bug for these ?
> Probably, two different bug are needed: hotspot/runtime and AWT.
Regarding the atoi on input provided by getenv - I'll open 2 bugs for this.
Best regards, Matthias
From: serguei.spitsyn@oracle.com <serguei.spitsyn@oracle.com>
Sent: Samstag, 14. September 2019 00:18
To: Baesken, Matthias <matthias.baesken@sap.com>; Thomas Stüfe \
<thomas.stuefe@gmail.com>
Cc: serviceability-dev@openjdk.java.net
Subject: Re: RFR [XS]: 8230901: missing ReleaseStringUTFChars in servicability native \
code
Hi Matthias,
On 9/12/19 4:52 AM, Baesken, Matthias wrote:
Hi Thomas, thanks for the review .
You are correct about atoi .
New webrev :
http://cr.openjdk.java.net/~mbaesken/webrevs/8230901.1/<http://cr.openjdk.java.net/%7Embaesken/webrevs/8230901.1/>
I had 2 additional observations :
1. With OJDK on solaris 32bit gone for quite some time, we might be able to \
kick out the whole non _LP64 code because we are always 64 bit
(maybe someone could comment if this is a safe assumption, there might be old 32bit \
solaris core files flying around for some reason even these days … )
http://cr.openjdk.java.net/~mbaesken/webrevs/8230901.1/src/jdk.hotspot.agent/solaris/n \
ative/libsaproc/saproc.cpp.frames.html<http://cr.openjdk.java.net/%7Embaesken/webrevs/8230901.1/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc.cpp.frames.html>
696 // some older versions of libproc.so crash when trying to attach 32 bit
697 // debugger to 64 bit core file. check and throw error.
698 #ifndef _LP64
…..
1. The usage of atoi is commented here :
https://docs.oracle.com/cd/E86824_01/html/E54766/atoi-3c.html
„However, applications should not use the atoi(), atol(), or atoll() functions \
unless they know the value represented by the argument will be in range for the \
corresponding result type"
……And here :
https://pubs.opengroup.org/onlinepubs/009695399/functions/atoi.html
"If the number is not known to be in range, \
strtol()<https://pubs.opengroup.org/onlinepubs/009695399/functions/strtol.html> \
should be used because atoi() is not required to perform any error checking"
However we have a number of usages in the coding where atoi is called without \
knowing that the argument is in the allowed range .
some examples :
src/hotspot/share/runtime/arguments.cpp-382- if (match_option(option, \
"-Dsun.java.launcher.pid=", &tail)) { src/hotspot/share/runtime/arguments.cpp:383: \
_sun_java_launcher_pid = atoi(tail); src/hotspot/share/runtime/arguments.cpp-384- \
continue;
src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
455 value = getenv("_AWT_MAX_POLL_TIMEOUT");
456 if (value != NULL) {
457 AWT_MAX_POLL_TIMEOUT = atoi(value);
src/java.desktop/unix/native/common/awt/X11Color.c-781- if (getenv("CMAPSIZE") \
!= 0) { src/java.desktop/unix/native/common/awt/X11Color.c:782: cmapsize = \
atoi(getenv("CMAPSIZE"));
Should I open a bug for these ?
Probably, two different bug are needed: hotspot/runtime and AWT.
Thanks,
Serguei
Best regards, Matthias
From: Thomas Stüfe <thomas.stuefe@gmail.com><mailto:thomas.stuefe@gmail.com>
Sent: Donnerstag, 12. September 2019 12:22
To: Baesken, Matthias <matthias.baesken@sap.com><mailto:matthias.baesken@sap.com>
Cc: serviceability-dev@openjdk.java.net<mailto:serviceability-dev@openjdk.java.net>
Subject: Re: RFR [XS]: 8230901: missing ReleaseStringUTFChars in servicability native \
code
Hi Matthias,
your changes look good.
an additional bug:
http://cr.openjdk.java.net/~mbaesken/webrevs/8230901.0/src/jdk.hotspot.agent/solaris/n \
ative/libsaproc/saproc.cpp.frames.html<http://cr.openjdk.java.net/%7Embaesken/webrevs/8230901.0/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc.cpp.frames.html>
698 #ifndef _LP64
699 atoi(cmdLine_cstr);
700 if (errno) {
Behaviour of atoi() in error case is undefined. errno values are not defined.
See: https://pubs.opengroup.org/onlinepubs/009695399/functions/atoi.html
And even if atoi would set errno, this is still not enough since errno may contain a \
stale value. One would have to set errno=0 before the function call.
If you want to fix this too 'd suggest replacing this call with strtol().
Cheers, Thomas
On Thu, Sep 12, 2019 at 12:11 PM Baesken, Matthias \
<matthias.baesken@sap.com<mailto:matthias.baesken@sap.com>> wrote: Hello, please \
reviews this small change .
It adds ReleaseStringUTFChars calls at some places in early return cases .
( in src/jdk.hotspot.agent/solaris/native/libsaproc/saproc.cpp
THROW_NEW_DEBUGGER_EXCEPTION contains a return , see the macro declaration
39 #define THROW_NEW_DEBUGGER_EXCEPTION(str) { throwNewDebuggerException(env, str); \
return;} )
Bug/webrev :
https://bugs.openjdk.java.net/browse/JDK-8230901
http://cr.openjdk.java.net/~mbaesken/webrevs/8230901.0/<http://cr.openjdk.java.net/%7Embaesken/webrevs/8230901.0/>
Thanks, Matthias
[Attachment #3 (text/html)]
<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;}
@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:Verdana;
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;}
@font-face
{font-family:"Courier New \;color\:black";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-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:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
tt
{mso-style-priority:99;
font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
mso-fareast-language:DE;}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:489104399;
mso-list-type:hybrid;
mso-list-template-ids:1675917122 67567633 67567641 67567643 67567631 67567641 \
67567643 67567631 67567641 67567643;} @list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1
{mso-list-id:1373767061;
mso-list-template-ids:-1944817522;}
@list l2
{mso-list-id:1517423003;
mso-list-template-ids:1884697564;}
@list l2:level1
{mso-level-start-at:2;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></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="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" \
style="color:windowtext;mso-fareast-language:EN-US">Hi Serguei and Thomas , \
thanks for the reviews.<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">>Should \
I open a bug for these ?</span><span lang="EN-US"><br> > Probably, two different \
bug are needed: hotspot/runtime and AWT.</span><span \
lang="EN-US"><o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="color:windowtext;mso-fareast-language:EN-US">Regarding the atoi on \
input provided by getenv - I'll open 2 bugs for \
this.<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="color:windowtext;mso-fareast-language:EN-US">Best regards, \
Matthias<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <div \
style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"> <div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" \
style="color:windowtext">From:</span></b><span lang="EN-US" style="color:windowtext"> \
serguei.spitsyn@oracle.com <serguei.spitsyn@oracle.com> <br>
<b>Sent:</b> Samstag, 14. September 2019 00:18<br>
<b>To:</b> Baesken, Matthias <matthias.baesken@sap.com>; Thomas Stüfe \
<thomas.stuefe@gmail.com><br> <b>Cc:</b> \
serviceability-dev@openjdk.java.net<br> <b>Subject:</b> Re: RFR [XS]: 8230901: \
missing ReleaseStringUTFChars in servicability native code<o:p></o:p></span></p> \
</div> </div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Matthias,<br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">On 9/12/19 4:52 AM, Baesken, Matthias wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Hi \
Thomas, thanks for the review .</span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">You are \
correct about atoi .</span><o:p></o:p></p> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">New webrev \
:</span><o:p></o:p></p> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <p \
class="MsoNormal"><a \
href="http://cr.openjdk.java.net/%7Embaesken/webrevs/8230901.1/"><span \
lang="EN-US">http://cr.openjdk.java.net/~mbaesken/webrevs/8230901.1/</span></a><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">I had 2 \
additional observations :</span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <ol \
style="margin-top:0cm" start="1" type="1"> <li class="MsoListParagraph" \
style="margin-left:0cm;mso-list:l0 level1 lfo3"><span lang="EN-US" \
style="mso-fareast-language:EN-US">With OJDK on solaris 32bit gone for quite \
some time, we might be able to kick out the whole non </span><span \
lang="EN-US" style="font-size:10.0pt;font-family:"Courier New \
;color:black",serif">_LP64 code because we are always 64 \
bit</span><o:p></o:p></li></ol> <p class="MsoListParagraph"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Courier New \
;color:black",serif">(maybe someone could comment if this is a safe \
assumption, there might be old 32bit solaris core files flying around for some \
reason even these days … )</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <p \
class="MsoNormal"><a \
href="http://cr.openjdk.java.net/%7Embaesken/webrevs/8230901.1/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc.cpp.frames.html"><span \
lang="EN-US">http://cr.openjdk.java.net/~mbaesken/webrevs/8230901.1/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc.cpp.frames.html</span></a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Courier New \
;color:black",serif">696 // some older versions of libproc.so crash \
when trying to attach 32 bit</span><o:p></o:p></p> <p class="MsoNormal"><span \
lang="EN-US" style="font-size:10.0pt;font-family:"Courier New \
;color:black",serif">697 // debugger to 64 bit core file. check and \
throw error.</span><o:p></o:p></p> <p class="MsoNormal"><span \
style="font-size:10.0pt;font-family:"Courier New ;color:black",serif">698 \
#ifndef _LP64</span><o:p></o:p></p> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US">…..</span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <ol \
style="margin-top:0cm" start="2" type="1"> <li class="MsoListParagraph" \
style="margin-left:0cm;mso-list:l0 level1 lfo3"><span lang="EN-US" \
style="mso-fareast-language:EN-US">The usage of atoi is commented here \
:</span><o:p></o:p></li></ol> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <p \
class="MsoNormal"><a \
href="https://docs.oracle.com/cd/E86824_01/html/E54766/atoi-3c.html"><span \
lang="EN-US">https://docs.oracle.com/cd/E86824_01/html/E54766/atoi-3c.html</span></a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">„</span><span lang="EN-US" \
style="font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white">However, \
applications should not use the </span><tt><span lang="EN-US" \
style="font-size:9.0pt;font-family:Courier;color:#444444;background:white">atoi()</span></tt><span \
lang="EN-US" style="font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white">, </span><tt><span \
lang="EN-US" style="font-size:9.0pt;font-family:Courier;color:#444444;background:white">atol()</span></tt><span \
lang="EN-US" style="font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white">,
or </span><tt><span lang="EN-US" \
style="font-size:9.0pt;font-family:Courier;color:#444444;background:white">atoll()</span></tt><span \
lang="EN-US" style="font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white"> functions \
unless they know the value represented by the argument will be in range for the \
corresponding result type"</span><o:p></o:p></p> <p class="MsoNormal"><span \
lang="EN-US" style="font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white"> \
……And here :</span><o:p></o:p></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><a \
href="https://pubs.opengroup.org/onlinepubs/009695399/functions/atoi.html"><span \
lang="EN-US">https://pubs.opengroup.org/onlinepubs/009695399/functions/atoi.html</span></a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US">"</span><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">If \
the number is not known to be in range, </span><a \
href="https://pubs.opengroup.org/onlinepubs/009695399/functions/strtol.html"><i><span \
lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#6666FF;background:white">strtol</span></i><span \
lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#6666FF;background:white">()</span></a><span \
lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> should
be used because <i>atoi</i>() is not required to perform any error \
checking"</span><o:p></o:p></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">However \
we have a number of usages in the coding where \
atoi is called without knowing that the argument is in the allowed range \
. </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">some \
examples :</span><o:p></o:p></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">src/hotspot/share/runtime/arguments.cpp-382- \
if (match_option(option, "-Dsun.java.launcher.pid=", &tail)) \
{</span><o:p></o:p></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">src/hotspot/share/runtime/arguments.cpp:383: \
_sun_java_launcher_pid = atoi(tail);</span><o:p></o:p></p> <p class="MsoNormal"><span \
lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;backgr \
ound:white">src/hotspot/share/runtime/arguments.cpp-384- \
continue;</span><o:p></o:p></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">455 \
value = getenv("_AWT_MAX_POLL_TIMEOUT");</span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">456 \
if (value != NULL) {</span><o:p></o:p></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">457 \
AWT_MAX_POLL_TIMEOUT = atoi(value);</span><o:p></o:p></p> <p class="MsoNormal"><span \
lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">s \
rc/java.desktop/unix/native/common/awt/X11Color.c-781- \
if (getenv("CMAPSIZE") != 0) {</span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">s \
rc/java.desktop/unix/native/common/awt/X11Color.c:782: \
cmapsize = atoi(getenv("CMAPSIZE"));</span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">Should \
I open a bug for these ?</span><o:p></o:p></p> </blockquote>
<p class="MsoNormal"><br>
Probably, two different bug are needed: hotspot/runtime and AWT.<br>
<br>
Thanks,<br>
Serguei<br>
<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white">Best \
regards, Matthias</span><o:p></o:p></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:10.0pt;font-family:"Verdana",sans-serif;background:white"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"> </span><o:p></o:p></p> <div \
style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"> <div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Thomas \
Stüfe <a href="mailto:thomas.stuefe@gmail.com"><thomas.stuefe@gmail.com></a> \
<br> <b>Sent:</b> Donnerstag, 12. September 2019 12:22<br>
<b>To:</b> Baesken, Matthias <a \
href="mailto:matthias.baesken@sap.com"><matthias.baesken@sap.com></a><br> \
<b>Cc:</b> <a href="mailto:serviceability-dev@openjdk.java.net">serviceability-dev@openjdk.java.net</a><br>
<b>Subject:</b> Re: RFR [XS]: 8230901: missing ReleaseStringUTFChars in \
servicability native code</span><o:p></o:p></p> </div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">Hi Matthias,<br>
<br>
your changes look good.<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
an additional bug:<br>
<br>
<a href="http://cr.openjdk.java.net/%7Embaesken/webrevs/8230901.0/src/jdk.hotspot.agen \
t/solaris/native/libsaproc/saproc.cpp.frames.html">http://cr.openjdk.java.net/~mbaeske \
n/webrevs/8230901.0/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc.cpp.frames.html</a>
<br>
<br>
698 #ifndef _LP64<br>
699 atoi(cmdLine_cstr);<br>
700 if (errno) {<br>
<br>
Behaviour of atoi() in error case is undefined. errno values are not defined.<br>
<br>
See: <a href="https://pubs.opengroup.org/onlinepubs/009695399/functions/atoi.html">
https://pubs.opengroup.org/onlinepubs/009695399/functions/atoi.html</a><br>
<br>
And even if atoi would set errno, this is still not enough since errno may contain a \
stale value. One would have to set errno=0 before the function call.<o:p></o:p></p> \
<div> <p class="MsoNormal"><br>
If you want to fix this too 'd suggest replacing this call with \
strtol().<o:p></o:p></p> <div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal">Cheers, Thomas<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, Sep 12, 2019 at 12:11 PM Baesken, Matthias <<a \
href="mailto:matthias.baesken@sap.com">matthias.baesken@sap.com</a>> \
wrote:<o:p></o:p></p> </div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm \
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt"> <div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span \
lang="EN-US">Hello, please reviews this small change .</span><o:p></o:p></p> <p \
class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span \
lang="EN-US"> </span><o:p></o:p></p> <p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">It \
adds ReleaseStringUTFChars calls at some places in early return \
cases .</span><o:p></o:p></p> <p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">( in \
src/jdk.hotspot.agent/solaris/native/libsaproc/saproc.cpp</span><o:p></o:p></p> <p \
class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span \
lang="EN-US"> </span><o:p></o:p></p> <p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span \
lang="EN-US">THROW_NEW_DEBUGGER_EXCEPTION contains a return , see the macro \
declaration</span><o:p></o:p></p> <p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span \
lang="EN-US"> </span><o:p></o:p></p> <pre><span lang="EN-US">39 #define \
THROW_NEW_DEBUGGER_EXCEPTION(str) { throwNewDebuggerException(env, str); \
return;}</span><o:p></o:p></pre> <p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span \
lang="EN-US">)</span><o:p></o:p></p> <p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span \
lang="EN-US"> </span><o:p></o:p></p> <p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span \
lang="EN-US"> </span><o:p></o:p></p> <p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span \
lang="EN-US"> </span><o:p></o:p></p> <p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span \
lang="EN-US">Bug/webrev :</span><o:p></o:p></p> <p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span \
lang="EN-US"> </span><o:p></o:p></p> <p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a \
href="https://bugs.openjdk.java.net/browse/JDK-8230901" \
target="_blank">https://bugs.openjdk.java.net/browse/JDK-8230901</a><o:p></o:p></p> \
<p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p> <p \
class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a \
href="http://cr.openjdk.java.net/%7Embaesken/webrevs/8230901.0/" \
target="_blank">http://cr.openjdk.java.net/~mbaesken/webrevs/8230901.0/</a><o:p></o:p></p>
<p class="MsoNormal" \
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p> <p \
class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks, \
Matthias<o:p></o:p></p> </div>
</div>
</blockquote>
</div>
</div>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic