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

[Bug]: macOS 15.2 + M4 Max #5217

Open
duwema opened this issue Jan 3, 2025 · 17 comments
Open

[Bug]: macOS 15.2 + M4 Max #5217

duwema opened this issue Jan 3, 2025 · 17 comments
Labels
bug Something isn't working

Comments

@duwema
Copy link

duwema commented Jan 3, 2025

Describe the bug

Service crash and dont start

To reproduce

Docker Desktop: 4.37.1 (178610)
Engine: 27.4.0
Compose: v2.31.0-desktop.2
Credential Helper: v0.8.2
Kubernetes: v1.30.5

macOS 15.2 (24C101)

  opensearch:
    image: opensearchproject/opensearch:2
    ports: [ "9200:9200", "9600:9600" ]
    volumes: [ search_data:/usr/share/opensearch/data ]
    environment:
      discovery.type: 'single-node'
      DISABLE_INSTALL_DEMO_CONFIG: true
      DISABLE_SECURITY_PLUGIN: true

Expected behavior

No response

Screenshots

If applicable, add screenshots to help explain your problem.

Host / Environment

No response

Additional context

may help: https://bugs.openjdk.org/browse/JDK-8345296

Relevant log output

2025-01-03 10:03:15 Disabling OpenSearch Security Plugin
2025-01-03 10:03:15 Enabling execution of OPENSEARCH_HOME/bin/opensearch-performance-analyzer/performance-analyzer-agent-cli for OpenSearch Performance Analyzer Plugin
2025-01-03 10:03:15 #
2025-01-03 10:03:15 # A fatal error has been detected by the Java Runtime Environment:
2025-01-03 10:03:15 #
2025-01-03 10:03:15 #  SIGILL (0x4) at pc=0x0000ffff67d3fc5c, pid=35, tid=36
2025-01-03 10:03:15 #
2025-01-03 10:03:15 # JRE version:  (21.0.5+11) (build )
2025-01-03 10:03:15 # Java VM: OpenJDK 64-Bit Server VM (21.0.5+11-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
2025-01-03 10:03:15 # Problematic frame:
2025-01-03 10:03:15 # j  java.lang.System.registerNatives()V+0 [email protected]
2025-01-03 10:03:15 #
2025-01-03 10:03:15 # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
2025-01-03 10:03:15 #
2025-01-03 10:03:15 # An error report file with more information is saved as:
2025-01-03 10:03:15 # /usr/share/opensearch/hs_err_pid35.log
2025-01-03 10:03:15 [0.014s][warning][os] Loading hsdis library failed
2025-01-03 10:03:15 #
2025-01-03 10:03:15 # The crash happened outside the Java Virtual Machine in native code.
2025-01-03 10:03:15 # See problematic frame for where to report the bug.
2025-01-03 10:03:15 #
2025-01-03 10:03:15 /usr/share/opensearch/bin/opensearch-env: line 99:    35 Aborted                 "$JAVA" "$XSHARE" -cp "$OPENSEARCH_CLASSPATH" org.opensearch.tools.java_version_checker.JavaVersionChecker
@duwema duwema added bug Something isn't working untriaged Issues that have not yet been triaged labels Jan 3, 2025
@marclennox
Copy link

@duwema Have you figured out a temporary workaround for this? I've been completely stopped by this for a month.

@rishabh6788
Copy link
Collaborator

@reta Are you aware of the jdk bug mentioned in the issue? https://bugs.openjdk.org/browse/JDK-8345296

@reta
Copy link
Contributor

reta commented Jan 7, 2025

@reta Are you aware of the jdk bug mentioned in the issue? https://bugs.openjdk.org/browse/JDK-8345296

@rishabh6788 sorry, I am not aware (still have no access to M1-M4 boxes), but it seems like there is a workaround mentioned here [1] that may help (besides that - we have to wait till 21.0.7 is released):

-XX:UseSVE=0

Thank you.

[1] corretto/corretto-21#85

@marclennox
Copy link

@reta Unfortunately there's no way I can find to pass this Java option through to the process that's crashing. Do we know if there is a JVM release that fixes this? If so, hopefully it's just a matter of releasing a new OpenSearch docker image with the fixed JVM?

@reta
Copy link
Contributor

reta commented Jan 7, 2025

If so, hopefully it's just a matter of releasing a new OpenSearch docker image with the fixed JVM?

@marclennox The fix went into JDK 21.0.7 [1] which is scheduled to be released on April 2025 [2] :( If we are lucky, it may get backported to JDK 21.0.6 (due on January 21st, but there no signs of that as of today).

[1] https://bugs.openjdk.org/browse/JDK-8346189
[2] https://wiki.openjdk.org/display/JDKUpdates/JDK+21u

@marclennox
Copy link

@reta Oh boy, that's not good. Is there any way to release a new version of OpenSearch docker that will allow the workaround JVM argument -XX:UseSVE=0 to get passed into the script that's crashing. My understanding from the limited research I've done is that it's not the actual OpenSearch process that's crashing (because if it were then you could use the environment variable to pass in the JVM arguments), but instead some sort of pre-script that gets run which doesn't obey the environment variables. I may have that wrong.

@reta
Copy link
Contributor

reta commented Jan 7, 2025

@reta Oh boy, that's not good. Is there any way to release a new version of OpenSearch docker that will allow the workaround JVM argument -XX:UseSVE=0 to get passed into the script that's crashing.

@marclennox I think you should be able to run the Docker image with altered JVM command (using OPENSEARCH_JAVA_OPTS), fe something along these lines:

docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e "OPENSEARCH_JAVA_OPTS=-XX:UseSVE=0" opensearchproject/opensearch:2.18.0

@marclennox
Copy link

@reta No that's what I'm saying, the script that's crashing is not using the OPENSEARCH_JAVA_OPTS environment variable.

@reta
Copy link
Contributor

reta commented Jan 7, 2025

@reta No that's what I'm saying, the script that's crashing is not using the OPENSEARCH_JAVA_OPTS environment variable.

@marclennox could you add this variable to environment section of the Docker compose file?

@duwema
Copy link
Author

duwema commented Jan 7, 2025

@reta No that's what I'm saying, the script that's crashing is not using the OPENSEARCH_JAVA_OPTS environment variable.

@marclennox could you add this variable to environment section of the Docker compose file?

  opensearch:
    image: opensearchproject/opensearch:2
    ports: [ "9200:9200", "9600:9600" ]
    volumes: [ search_data:/usr/share/opensearch/data ]
    environment:
      discovery.type: 'single-node'
      DISABLE_INSTALL_DEMO_CONFIG: true
      DISABLE_SECURITY_PLUGIN: true
      OPENSEARCH_JAVA_OPTS: -XX:UseSVE=0

same issue, tested also OPENSEARCH_JAVA_OPTS: "-XX:UseSVE=0"

@reta
Copy link
Contributor

reta commented Jan 7, 2025

@duwema sad, sorry may I ask you please to try

JAVA_TOOL_OPTIONS: "-XX:UseSVE=0"

(I sadly have no access to M4 box to reproduce the issue)

@duwema
Copy link
Author

duwema commented Jan 7, 2025

@reta sadly the issue dosent change with

JAVA_TOOL_OPTIONS: "-XX:UseSVE=0"

@reta
Copy link
Contributor

reta commented Jan 7, 2025

@rishabh6788 I may ask for help with the issue, do you have access macOS 15.2 + M4 Max? (I don't sadly)

@marclennox
Copy link

@reta Yes I tried that a few weeks ago, it does nothing. However, I found a workaround from the elastic project, which is dealing with the same issue.

elastic/elasticsearch#118583

If you include the _JAVA_OPTIONS environment variable in docker-compose.yml, it all works!

_JAVA_OPTIONS=-XX:UseSVE=0

@reta
Copy link
Contributor

reta commented Jan 7, 2025

If you include the _JAVA_OPTIONS environment variable in docker-compose.yml, it all works!

Thank you @marclennox , this is very surprising, the _JAVA_OPTIONS is supposed to be superseded by JAVA_TOOL_OPTIONS as per [1]

[1] https://bugs.openjdk.org/browse/JDK-4971166

@duwema
Copy link
Author

duwema commented Jan 7, 2025

@reta
can confirm _JAVA_OPTIONS: -XX:UseSVE=0 works

    environment:
      discovery.type: 'single-node'
      DISABLE_INSTALL_DEMO_CONFIG: true
      DISABLE_SECURITY_PLUGIN: true
      _JAVA_OPTIONS: -XX:UseSVE=0

@iammerrick
Copy link

Forcing it to go through amd QEMU emulation also works for me as a temporary work around: --platform linux/amd64

@gaiksaya gaiksaya removed the untriaged Issues that have not yet been triaged label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🆕 New
Development

No branches or pull requests

6 participants