Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rosetta emulation of amd64 version of ibm-semeru-runtimes:open-11-jdk-focal stopped working with macOS Sonoma 14.3 #7180

Closed
elmnic opened this issue Feb 8, 2024 · 7 comments

Comments

@elmnic
Copy link

elmnic commented Feb 8, 2024

Description

Using the amd64 version of ibm-semeru-runtimes:open-11-jdk-focal and attempting to run java using it results in the output:

docker run --rm --platform=linux/amd64 ibm-semeru-runtimes:open-11-jdk-focal java --version
libjvm.so preloadLibrary(/opt/java/openjdk/lib/default/libj9vm29.so): /opt/java/openjdk/lib/default/libj9vm29.so: cannot enable executable stack as shared object requires: Invalid argument
libjvm.so failed to load: j9vm29

Downgrading Docker Desktop to 4.26.1 made no difference.
Running on another Mac with Sonoma 14.2.x works both with and without Rosetta enabled.

Edit:
Using Temurin works but is not an option.
Upgrading Docker Desktop to 4.27.2 didn't solve it.

Reproduce

Running this on macOS Sonoma 14.3 with Docker Desktop 4.27.1

docker run --rm --platform=linux/amd64 ibm-semeru-runtimes:open-11-jdk-focal java --version

produces

libjvm.so preloadLibrary(/opt/java/openjdk/lib/default/libj9vm29.so): /opt/java/openjdk/lib/default/libj9vm29.so: cannot enable executable stack as shared object requires: Invalid argument
libjvm.so failed to load: j9vm29

Expected behavior

docker run --rm --platform=linux/amd64 ibm-semeru-runtimes:open-11-jdk-focal java --version should print out the java version with Rosetta enabled

Output with Rosetta disabled in Docker Desktop

docker run --rm --platform=linux/amd64 ibm-semeru-runtimes:open-11-jdk-focal java --version
openjdk 11.0.21 2023-10-17
IBM Semeru Runtime Open Edition 11.0.21.0 (build 11.0.21+9)
Eclipse OpenJ9 VM 11.0.21.0 (build openj9-0.41.0, JRE 11 Linux amd64-64-Bit Compressed References 20231122_912 (JIT enabled, AOT enabled)
OpenJ9   - 461bf3c70
OMR      - 5eee6ad9d
JCL      - 0fd7a05277 based on jdk-11.0.21+9)

docker version

Client:
 Cloud integration: v1.0.35+desktop.10
 Version:           25.0.2
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        29cf629
 Built:             Thu Feb  1 00:18:45 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.27.1 (136059)
 Engine:
  Version:          25.0.2
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       fce6e0c
  Built:            Thu Feb  1 00:23:21 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    25.0.2
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1-desktop.4
    Path:     /Users/niclas/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.3-desktop.1
    Path:     /Users/niclas/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container. (Docker Inc.)
    Version:  0.0.22
    Path:     /Users/niclas/.docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/niclas/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.21
    Path:     /Users/niclas/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     /Users/niclas/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.0.0
    Path:     /Users/niclas/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/niclas/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.3.0
    Path:     /Users/niclas/.docker/cli-plugins/docker-scout
WARNING: Plugin "/Users/niclas/.docker/cli-plugins/docker-scan" is not valid: failed to fetch metadata: fork/exec /Users/niclas/.docker/cli-plugins/docker-scan: no such file or directory

Server:
 Containers: 60
  Running: 0
  Paused: 0
  Stopped: 60
 Images: 407
 Server Version: 25.0.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.6.12-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 12
 Total Memory: 31.3GiB
 Name: docker-desktop
 ID: c8e96450-62ff-4f70-9f09-4e81b03ad2ee
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: daemon is not using the default seccomp profile

Diagnostics ID

BE30248B-B1A2-4992-8CC6-2AA3241976AC/20240208155104

Additional Info

Running with Rosetta disabled in Docker Desktop is not an option because other images fail to run instead.

@dgageot
Copy link
Member

dgageot commented Feb 14, 2024

@elmnic This is a regression in Rosetta, on Apple's side. macOS Sonoma 14.3 ships with this regression. We'll contact Apple to see when they can fix it. For now, we've prepared a workaround we're planning on shipping with Docker Desktop 4.28.0.

@filmackay
Copy link

@dgageot do you think this was fixed in 4.28.0? We are still seeing the regression with our own software, could it be a different case?

ghc-pkg: error while loading shared libraries: libHSrts-ghc9.0.2.so: cannot enable executable stack as shared object requires: Invalid argument

@datalogics-kam
Copy link

@dgageot What was the workaround that goes with Docker 4.28.0? I upgraded to Docker Desktop 4.28.0, and still get the error that we were getting with our own built product. Is there some other setting or condition we have to set up? Did the workaround make it into the release?

stderr: /xxx/xxx/xxx: error while loading shared libraries: libXXxxx.so.1.0.0: cannot enable executable stack as shared object requires: Invalid argument

I don't know why some of our shared libraries have the executable stack bit set; I checked our source code for the option. I guess in some cases, the compiler thinks that bit is necessary and turns it on automatically.

execstack -c does not work on all of our libraries either.

If I turn off Rosetta and use QEMU, our code just crashes instead, and so does Node.js.

@dgageot
Copy link
Member

dgageot commented Feb 27, 2024

@datalogics-kam unfortunately, we didn't ship a workaround. Apple has fixed the issue on their side, it should ship with a future patch release of macOS.

@mingcyu
Copy link

mingcyu commented Feb 27, 2024

@dgageot Thanks for the update, is there a particular public item from the Apple side we can communicate with our customers or its a wait and see ?

@filmackay
Copy link

filmackay commented Feb 28, 2024

Looks like this was fixed in macOS 14.4 (developer) beta 5. Unmentioned in release notes, however.

@elmnic
Copy link
Author

elmnic commented Mar 11, 2024

macOS 14.4 is officially out now and has the fix included. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants