Setting Java Flight Recorder option forces English locale
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openjdk-lts (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
(I don't have access to file bugs upstream at <https:/
Platform information:
$ uname -m
x86_64
$ lsb_release -d
Description: Ubuntu 20.04.1 LTS
$ dpkg -S $(readlink -f $(which java))
openjdk-
$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+
OpenJDK 64-Bit Server VM (build 11.0.8+
Test case to reproduce the problem:
$ cat > JfrOptLocBugRep
public class JfrOptLocBugRepro {
public static void main(String[] args) {
System.
}
}
EOF
$ javac JfrOptLocBugRep
Normal behaviour; nb_NO.utf8 is a locale where the thousands grouping and decimal symbol is different from en_US.utf8 and is used as an example; I believe this problem does not only apply to this locale in particular.
$ LANG=en_US.utf8 java -cp . JfrOptLocBugRepro
1,234,567.09
$ LANG=nb_NO.utf8 java -cp . JfrOptLocBugRepro
1 234 567,09
Problem description; If a flight recorder option is added, the numeric string is no longer formatted according to the locale.
$ LANG=nb_NO.utf8 java -cp . -XX:FlightRecor
1 234 567,09
$ LANG=nb_NO.utf8 java -cp . -XX:FlightRecor
1,234,567.09
A cause may be that the flight recorder uses string formatting to build some internal debug strings, and this cause a premature and incorrect initialization of the locale.
Status changed to 'Confirmed' because the bug affects multiple users.