Zhengyu
Earlier creation of the environmental variable.
http://cr.openjdk.java.net/~ntoda/8042469/webrev-07/
The new webrev [07] places the new code in the function SetJvmEnvironment()
===
. JLI_Launch()
. InitLauncher()
. CreateExecutionEnvironment()
. CheckJvmType()
.
Hi Neil,
There is still an issue. Apparently, you can NOT free the buffer for the
environment variable.
678 char * pbuf = (char*)JLI_MemAlloc(pbuflen);
679 JLI_Snprintf(pbuf, pbuflen, %s%d=%s, NMT_Env_Name,
JLI_GetPid(), value);
680 retval =
You are right. I found this upon looking:
https://www.securecoding.cert.org/confluence/display/seccode/POS34-C.+Do+not+call+putenv()+with+a+pointer+to+an+automatic+variable+as+the+argument
We moved to malloc since the launcher doesn't know about the value being
passed
with the native memory
The possible values are: off, summary and detail
Thanks,
-Zhengyu
On 6/26/2014 3:58 PM, Neil Toda wrote:
You are right. I found this upon looking:
Sorry. One more webrev .. 06
http://cr.openjdk.java.net/~ntoda/8042469/webrev-06/
Kumar's nit was correct and in fact index was old and should have been
removed
allowing .contains member to be used instead of .indexOf. So cleaned up
a bit more
as can be seen below. Other of Kumar's nits
Hi Neil,
I tried out this patch with my hotspot, it does not work.
The reason is that, the environment variable is setup too late, it has
to be set before it launches JavaVM (before calling LoadJavaVM()) method.
Thanks,
-Zhengyu
On 6/25/2014 1:58 PM, Neil Toda wrote:
Sorry. One more
Hi Zhengyu,
You are right then this needs to happen before LoadJavaVM, I think that
is where it was initially,
but I had Neil move it to ParseArguments where all the arguments are parsed.
Also it is probably best that you push this changeset when it is
complete, into hotspot-dev, along
Neil,
Some nits:
TestSpecialArgs.java:
extra space
105 for ( String line : tr.testOutput) {
This is very C'ish, I suggest.
-106 int index;
-107 if ((index = line.indexOf(envVarPidString)) = 0) {
+106 int index =
I've spun a new webrev based on the comments for webrev-03:
http://cr.openjdk.java.net/~ntoda/8042469/webrev-04/
Changes are:
1) java.c
a) add free(envName) line 1063
b) change from malloc() to JLI_MemAlloc() @ lines 1048 and 1056
Thanks
-neil
On 6/20/2014 4:45 PM,
Neil,
Thanks for quick implementation.
java.c:
Did not check return values of malloc(), I wonder if source code
analyzers will complain.
-Zhengyu
On 6/19/2014 8:29 PM, Neil Toda wrote:
Launcher support for modified Native Memory Tracking mechanism in JVM
in JDK9.
Webrev :
Memory allocation in the launcher should use one of the JLI_MemAlloc
wrappers, if possible.
-Joe
On 06/20/2014 09:50 AM, Neil Toda wrote:
They should complain. Thanks Zhengyu. I'll make sure these are
non-null.
-neil
On 6/20/2014 5:01 AM, Zhengyu Gu wrote:
Neil,
Thanks for quick
Thanks Joe. It would have checked for NULL for me.
I'll use the JLI wrapper.
-neil
On 6/20/2014 4:04 PM, Joe Darcy wrote:
Memory allocation in the launcher should use one of the JLI_MemAlloc
wrappers, if possible.
-Joe
On 06/20/2014 09:50 AM, Neil Toda wrote:
They should complain.
Neil,
Generally looks good, yes JLI_* functions must be used, I missed that one.
Are you going to post another iteration ?
Kumar
On 6/20/2014 4:27 PM, Neil Toda wrote:
Thanks Joe. It would have checked for NULL for me.
I'll use the JLI wrapper.
-neil
On 6/20/2014 4:04 PM, Joe Darcy wrote:
Thanks Kumar for your other finds. I'll spin another webrev this
evening and post
it with the fixes to address everyone's points.
Thanks.
-neil
On 6/20/2014 4:45 PM, Kumar Srinivasan wrote:
Neil,
Generally looks good, yes JLI_* functions must be used, I missed that
one.
Are you going
Launcher support for modified Native Memory Tracking mechanism in JVM in
JDK9.
Webrev : http://cr.openjdk.java.net/~ntoda/8042469/webrev-03/
bug : https://bugs.openjdk.java.net/browse/JDK-8042469
CCC : http://ccc.us.oracle.com/8042469
Thanks.
-neil
Hi Neil,
1054 envName = malloc(pbuflen);
envName is never freed looks like. Probably not a big deal since this runs
only if launcher is traced, but thought I'd mention it.
Sent from my phone
On Jun 19, 2014 8:30 PM, Neil Toda neil.t...@oracle.com wrote:
Launcher support
Thanks Vitaly. Best to cleanup. I'll make that change.
-neil
On 6/19/2014 5:39 PM, Vitaly Davidovich wrote:
Hi Neil,
1054 envName = malloc(pbuflen);
envName is never freed looks like. Probably not a big deal since this
runs only if launcher is traced, but thought
17 matches
Mail list logo