Review request for 7034570

David Holmes David.Holmes at oracle.com
Wed Apr 13 11:29:52 UTC 2011


Hi Michael,

Michael McMahon said the following on 04/13/11 21:33:
> This issue occurs on some versions of Windows since we switched compiler
> to VC 2010. The new C runtime library requires the "SystemRoot" environment
> variable to be set, when launching sub-processes via Runtime.exec() or 
> ProcessBuilder.
> 
> The problem occurs in instances where the environment is specified by 
> the caller,
> rather than simply inheriting (or inheriting and adding to) the 
> environment of the parent process.
> 
> The change is simple enough. We just check for the presence of 
> "SystemRoot" in the
> child process's environment, and set it if it's not there.  No change 
> will be visible
> to the parent process. But, to avoid ambiguity, we'd like to make the 
> change explicit with a small spec. change.

Spec change seems fine to me.

> http://cr.openjdk.java.net/~michaelm/7034570/webrev.1/

Is it possible to watch for the SystemRoot entry while iterating through 
at line 322 (ProcessEnvironment.java) instead of doing the iterative 
search before-hand? Or even doing the sort first and then a 
binary-search? Maybe the environment on windows is small enough that 
this isn't an issue?

Also what if the parent process doesn't have SystemRoot set in its 
environment?  Does the child just get a 'null' entry?

Cheers,
David


> Thanks,
> Michael.



More information about the core-libs-dev mailing list