Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8255239

The timezone of the hs_err_pid log file is corrupted in Japanese locale

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b23
    • CPU:
      x86_64
    • OS:
      windows
    • Verification:
      Not verified

      Backports

        Description

        ADDITIONAL SYSTEM INFORMATION :
        OS: Windows 10 / Windows Server 2019
        Java: 8u272, 11.0.8, 16ea

        A DESCRIPTION OF THE PROBLEM :
        The time and timezone of the crash are written to the hs_err_pid log file.
        However, the timezone output is corrupted on the Japanese locale windows.

        The hotspot uses strftime api to get the timezone on windows.
        In Visual Studio 2010 (Official build for JDK8 FCS), this api correctly printed the timezone for Japanese locales in multibyte characters.
        However, in the latest Visual Studio 2017, strftime no longer correctly prints the timezone for Japanese locales.
        This looks like a regression from a compiler change.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. build UnsafeCrash.java
           javac --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED UnsafeCrash.java
        2. run UnsafeCrash on ja_JP locale system
           java --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED UnsafeCrash
        3. confirm the "Time:" line of the hs_err_pid log

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Time: Fri Oct 16 11:26:20 2020 東京 (標準時) elapsed time: 0.457942 seconds (0d 0h 0m 0s)
        ACTUAL -
        Time: Fri Oct 16 11:26:20 2020 ???? (?W?€??) elapsed time: 0.457942 seconds (0d 0h 0m 0s)

        ---------- BEGIN SOURCE ----------
        import jdk.internal.misc.Unsafe;
        public class UnsafeCrash {
          public static void main(String[] args) throws Throwable {
            Unsafe.getUnsafe().putInt(0L, 0);
          }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Set the TZ environment variable to single byte character. (e.g. set TZ=Asia/Tokyo)

        FREQUENCY : always


          Attachments

          1. bad.PNG
            bad.PNG
            1.0 kB
          2. en.PNG
            en.PNG
            1 kB
          3. good.PNG
            good.PNG
            1 kB
          4. ja.PNG
            ja.PNG
            0.9 kB
          5. timetest_w.c
            0.4 kB
          6. timetest.c
            0.3 kB
          7. UnsafeCrash.java
            0.2 kB

            Issue Links

              Activity

                People

                Assignee:
                ccheung Calvin Cheung
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: