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

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 15, 16, 17
    • 17
    • hotspot
    • None
    • b15
    • aarch64
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: