On Wed, 6 Mar 2024 11:57:27 GMT, Andrew John Hughes <and...@openjdk.org> wrote:

> The HotSpot code has inserted the value of `HOTSPOT_BUILD_USER` into the 
> internal version string since before the JDK was open-sourced, so the 
> reasoning for this is not in the public history. See 
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/abstract_vm_version.cpp#L284
> 
> ~~~
> $ /usr/lib/jvm/java-21-openjdk/bin/java -Xinternalversion
> OpenJDK 64-Bit Server VM (21.0.2+13) for linux-amd64 JRE (21.0.2+13), built 
> on 2024-01-19T16:39:52Z by "mockbuild" with gcc 8.5.0 20210514 (Red Hat 
> 8.5.0-20)
> ~~~
> 
> It is not clear what value this provides. By default, the value is set to the 
> system username, but it can be set to a static value using 
> `--with-build-user`.
> 
> In trying to compare builds, this is a source of difference if the builds are 
> produced under different usernames and `--with-build-user` is not set to the 
> same value.
> 
> It may also be a source of information leakage from the host system. It is 
> not clear what value it provides to the end user of the build.
> 
> This patch proposes removing it altogether, but at least knowing why it needs 
> to be there would be progress from where we are now. We could also consider a 
> middle ground of only setting it for "adhoc" builds, those without set 
> version information, as is the case with the overall version output. 
> 
> With this patch:
> 
> ~~~
> $ ~/builder/23/images/jdk/bin/java -Xinternalversion
> OpenJDK 64-Bit Server VM (fastdebug 23-internal-adhoc.andrew.jdk) for 
> linux-amd64 JRE (23-internal-adhoc.andrew.jdk), built on 2024-03-06T00:23:37Z 
> with gcc 13.2.1 20230826
> 
> $ ~/builder/23/images/jdk/bin/java -XX:ErrorHandlerTest=1
> <vm crashes>
> $ grep '^vm_info' 
> /localhome/andrew/projects/openjdk/upstream/jdk/hs_err_pid1119824.log
> vm_info: OpenJDK 64-Bit Server VM (fastdebug 23-internal-adhoc.andrew.jdk) 
> for linux-amd64 JRE (23-internal-adhoc.andrew.jdk), built on 
> 2024-03-06T00:23:37Z with gcc 13.2.1 20230826
> ~~~
> 
> The above are from a fastdebug build but I also built a product build with no 
> issues.

The internal version is reported in crash reports (hs_err file) as well as via 
`-Xinternalversion`.

My recollection is that the username was needed/used to identify whether a 
hs_err report came from an official build, back when official builds were 
created via a very specific build process and a specific user name. These days 
it seems redundant given the way the rest of the version string is constructed 
both for "official" builds and personal builds.

I can't see any tests that look at the output from `-Xinternalversion`.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18136#issuecomment-1982679336

Reply via email to