RFR [XS]: 8239462: jdk.hotspot.agent misses some ReleaseStringUTFChars calls in case of early returns
Baesken, Matthias
matthias.baesken at sap.com
Thu Feb 20 08:53:41 UTC 2020
Hi Alex / Christoph, thanks for the reviews.
New webrev :
http://cr.openjdk.java.net/~mbaesken/webrevs/8239462.1/
- includes LinuxDebuggerLocal.cpp
- adds a blank Christoph wanted to have
A question (hopefully not a stupid one ):
At most places in the coding, GetStringUTFChars success is
1. handled by checking NULL , like this :
const char *s = (*env)->GetStringUTFChars(env, p, NULL);
if (s == NULL) {
// handle failure
}
2.At some places , success / failure is not handled at all .
3.Here (e.g. LinuxDebuggerLocal.cpp) success / failure check is done by
if (env->ExceptionOccurred()) { ... }
Which one is the best / right way to do it (most likely not 2.) ?
Best regards, Matthias
>
> Looks like
> src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp
> has similar issues. It would be nice to fix them as well.
>
> --alex
>
> On 02/19/2020 06:21, Baesken, Matthias wrote:
> > Hello, please review this small change .
> > We miss at a few places ReleaseStringUTFChars calls in the native
> > jdk.hotspot.agent coding.
> > This happens in case of early returns .
> >
> >
> > Bug/webrev :
> >
> > https://bugs.openjdk.java.net/browse/JDK-8239462
> >
> > http://cr.openjdk.java.net/~mbaesken/webrevs/8239462.0/
> >
> >
> > Thanks, Matthias
> >
More information about the hotspot-dev
mailing list