Skip to content

Stack size is too small for arm64 platform #192

Closed

Description

@maaaace

Currently I try to run cassandra through official images, but the container cannot be started as "The stack size specified is too small, Specify at least 328k".

My docker environment is on 64bit ARMv8 Kunpeng920 CPU and I'v checked the architecture of image is "arm64".
image

After checking the option "-Xss" in jvm.options or cassandra-env.sh locating in the container, I find all of them are using "-Xss256k".
image

Activity

  1. added
    question
    on Oct 10, 2019
  2. wglambert commented on Oct 10, 2019

    @wglambert

    Same issue as #174, it wasn't able to be reproduced and when he used Ubuntu there wasn't an issue

    You could try Docker's memory limit flag -m 3.5G
    https://docs.docker.com/config/containers/resource_constraints/#limit-a-containers-access-to-memory

  3. yosifkit commented on Oct 10, 2019

    @yosifkit
    Member

    Yeah, I'd say this is a duplicate of #174 and the conclusion from the person reporting the issue was that it was host OS related (both on Centos 7, but Ubuntu worked fine). Can you give any more details that would prove otherwise?

  4. maaaace commented on Oct 11, 2019

    @maaaace
    Author

    @wglambert
    Appreciate your suggestion. I've tried memory limit flag but it does not work.

  5. maaaace commented on Oct 11, 2019

    @maaaace
    Author

    @yosifkit I did further investigation about this issue. have to say this is OS related and also the architecutre causes it together.

    Follow your suggestion, I upgrade Docker version on both CentOS and Ubuntu. Here is the result.
    image
    This table indicates that all the images fail to start a container with the error message "The stack size specified is too small, Specify at least 328k".

    After adjusting -Xss on arm64 Ubuntu and x86 CentOS, I find the minimal stack size per thread of each OS/architecture are different.
    arm64 CentOS7.6 328k
    arm64 Ubuntu18.04 164k
    x86 CentOS7.6 228k

    Checking openjdk-1.8.0 source code, the error is from code snippet below.
    image
    It shows min_stack_allowed is related to StackYellowPage, StackRedPage, StackShadowPage, OS page size and VM default page size(8k). StackYellow/Red/ShadowPage could be checked with PrintFlagsFinal and page size is different corresponding to OS. Default page size of CentOS7.6 for arm64 is 64k, however, Ubuntu18.04 for arm64 and CentOS7.6 for x86 are both 4k.
    arm64 CentOS7.6 64bit
    image
    min_stack_allowed = 3 * 64 + ( 2 * 8 + 1) * 8 = 328k

    arm64 Ubuntu18.04 64bit
    image
    min_stack_allowed = 7 * 4 + ( 2 * 8 + 1) * 8 = 164k

    x86 CentOS7.6 64bit
    image
    min_stack_allowed = 228k

    That's the reason why CentOS7.6 for arm64 cannot start canssandra docker images as jvm option "-Xss256k". In order to support it, could we have some change on this option?
    waiting for your reply, thanks a lot.

  6. binbinshi commented on Nov 30, 2019

    @binbinshi

    I run it on os
    Linux version 4.14.0-115.el7a.0.1.aarch64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)) #1 SMP Sun Nov 25 20:54:21 UTC 2018
    see the same error ;
    The stack size specified is too small, Specify at least 328k Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

    use cassandra image arm64v8/cassandra:3.11.5 ,download url https://hub.docker.com/r/arm64v8/cassandra/ ;
    can anyone fix it ?

    update 2019/12/02
    update the config of conf/jvm.options -Xss
    Per-thread stack size. -Xss512k
    my problem solved;

  7. tianon commented on Dec 20, 2023

    @tianon
    Member

    Unfortunately, this is not something we plan to change -- CentOS 7 is very close to EOL, and we generally strive to stay as true as possible to upstream's defaults.

  8. xtha commented on Mar 8, 2024

    @xtha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions