openjdk team mailing list archive
-
openjdk team
-
Mailing list archive
-
Message #14009
[Bug 1892340] [NEW] Setting Java Flight Recorder option forces English locale
Public bug reported:
(I don't have access to file bugs upstream at
<https://bugs.openjdk.java.net/>)
Platform information:
$ uname -m
x86_64
$ lsb_release -d
Description: Ubuntu 20.04.1 LTS
$ dpkg -S $(readlink -f $(which java))
openjdk-11-jre-headless:amd64: /usr/lib/jvm/java-11-openjdk-amd64/bin/java
$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)
Test case to reproduce the problem:
$ cat > JfrOptLocBugRepro.java <<EOF
public class JfrOptLocBugRepro {
public static void main(String[] args) {
System.out.println(new java.text.DecimalFormat("###,###.00").format(1234567.089));
}
}
EOF
$ javac JfrOptLocBugRepro.java
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:FlightRecorderOptions= JfrOptLocBugRepro
1 234 567,09
$ LANG=nb_NO.utf8 java -cp . -XX:FlightRecorderOptions=stackdepth=256 JfrOptLocBugRepro
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.
** Affects: openjdk-lts (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of OpenJDK,
which is subscribed to openjdk-lts in Ubuntu.
https://bugs.launchpad.net/bugs/1892340
Title:
Setting Java Flight Recorder option forces English locale
Status in openjdk-lts package in Ubuntu:
New
Bug description:
(I don't have access to file bugs upstream at
<https://bugs.openjdk.java.net/>)
Platform information:
$ uname -m
x86_64
$ lsb_release -d
Description: Ubuntu 20.04.1 LTS
$ dpkg -S $(readlink -f $(which java))
openjdk-11-jre-headless:amd64: /usr/lib/jvm/java-11-openjdk-amd64/bin/java
$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)
Test case to reproduce the problem:
$ cat > JfrOptLocBugRepro.java <<EOF
public class JfrOptLocBugRepro {
public static void main(String[] args) {
System.out.println(new java.text.DecimalFormat("###,###.00").format(1234567.089));
}
}
EOF
$ javac JfrOptLocBugRepro.java
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:FlightRecorderOptions= JfrOptLocBugRepro
1 234 567,09
$ LANG=nb_NO.utf8 java -cp . -XX:FlightRecorderOptions=stackdepth=256 JfrOptLocBugRepro
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openjdk-lts/+bug/1892340/+subscriptions
Follow ups