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

hotspot ignores PTHREAD_STACK_MIN when creating new threads

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9, 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b21

      Description

      Hotspot creates new threads with the stack size specified by -Xss. It uses pthread_attr_setstacksize() to do that. On xgene systems it's been observed that the call to pthread_attr_setstacksize() is failing with EINVAL when small stack sizes are specified, so we end up with the default 8mb stack size. This happens when the stack size is less than PTHREAD_STACK_MIN. On xgene we allow stack sizes as small as 72k (based on a computation of the minimum size needed), so basically any -Xss stack size of 72k to 124k will produce this result. This means users trying to minimize stack sizes might actually end up doing the opposite when choosing these smaller sizes.

      This fix should be simple. When we compute _java_thread_min_stack_allowed, we should always round up to PTHREAD_STACK_MIN. This will causes -Xss stack sizes less than 128k to produce an error message saying the minimum allowed is 128k.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cjplummer Chris Plummer
                Reporter:
                cjplummer Chris Plummer
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: