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

macOS M1: report in hs_err log if we are running x86 code in emulation mode (Rosetta)

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 15, 16, 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b15
    • CPU:
      aarch64
    • OS:
      os_x

      Description

      During JDK-8261397 review David brought up a good point on how one can tell, from the hs_err log file, whether we are running x86 code on ARM hardware.

      Currently one can infer it by looking at the "system" section and looking at the Darwin kernel version ex:

      OS:uname: Darwin 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 x86_64

      Here we see "RELEASE_ARM64_T8101" running "x86_64", so we can infer the code is running in emulation mode, however, we can explicitly check for that using the code provided by Apple:

      https://developer.apple.com/documentation/apple_silicon/about_the_rosetta_translation_environment?language=objc#3616845

      and report it in the log in a direct way.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gziemski Gerard Ziemski
              Reporter:
              gziemski Gerard Ziemski
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: