RFR [XS]: 8230901: missing ReleaseStringUTFChars in servicability native code

Thomas Stüfe thomas.stuefe at gmail.com
Thu Sep 12 10:21:49 UTC 2019


Hi Matthias,

your changes look good.

an additional bug:

http://cr.openjdk.java.net/~mbaesken/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 at 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/
>
>
>
> Thanks, Matthias
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20190912/8abf06bf/attachment.html>


More information about the serviceability-dev mailing list