RFR: JDK-8284726: Print active locale settings in hs_err reports and in VM.info [v3]

Thomas Stuefe stuefe at openjdk.java.net
Wed Apr 27 16:53:38 UTC 2022


> To analyze locale problems in native code - e.g. stemming from third-party code calling `setlocale(3)` - it would be useful to print the active locale settings in hs-err reports and in VM.info.
> 
> Patch notes: 
> - Posix is fuzzy about the exact role of LC_ALL. It defines LC_ALL as a way to set all locales in one go, but the implementation could still keep the individual categories separately and just let LC_ALL override the individual settings. Therefore I opted to print both, even though on glibc the information seems redundant.
> - Since this is Posix specific, callers require #ifndef _WIN32 in shared files. That's not nice, but the alternative would be an empty stub implementation for windows, which I find also unappealing.
> 
> Example output, Ubuntu 20.04:
> 
> Java started with LC_ALL=C:
> 
> thomas at starfish $ jcmd Simple VM.info | ack LC_
> LC_ALL=C
> LC_ALL=C
> LC_COLLATE=C
> LC_CTYPE=C
> LC_MESSAGES=C
> LC_MONETARY=C
> LC_NUMERIC=C
> LC_TIME=C
> 
> 
> Java started with my default system settings:
> 
> thomas at starfish $ jcmd Simple VM.info | ack LC_
> LC_ALL=LC_CTYPE=C;LC_NUMERIC=en_DK.UTF-8;LC_TIME=en_DK.UTF-8;LC_COLLATE=C;LC_MONETARY=en_DK.UTF-8;LC_MESSAGES=C;LC_PAPER=en_DK.UTF-8;LC_NAME=en_DK.UTF-8;LC_ADDRESS=en_DK.UTF-8;LC_TELEPHONE=en_DK.UTF-8;LC_MEASUREMENT=en_DK.UTF-8;LC_IDENTIFICATION=en_DK.UTF-8
> LC_COLLATE=C
> LC_CTYPE=C
> LC_MESSAGES=C
> LC_MONETARY=en_DK.UTF-8
> LC_NUMERIC=en_DK.UTF-8
> LC_TIME=en_DK.UTF-8

Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:

  Fix copyright

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8194/files
  - new: https://git.openjdk.java.net/jdk/pull/8194/files/f168c8a9..93347f86

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8194&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8194&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8194.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8194/head:pull/8194

PR: https://git.openjdk.java.net/jdk/pull/8194


More information about the hotspot-dev mailing list