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

STACK_SIZE_MINIMUM of 32k is not always enough for Mac OS X

    Details

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

      Description

      The fix for JDK-6762191 forced the stack size to be at least 32k if you specified something smaller with -Xss. This allowed you to get to the point where hotspot determines the actual minimum stack size, and will generate an appropriate error message stating such. Before doing this, very small stack sizes would crash before ever getting to the point where hotspot tells you the stack size is too small. It looks like 32k is not always big enough on Mac OS X. I've noticed TooSmallStackSize.java failing sometimes because of this. The following demonstrates this:

      $> bin/java -Xss16k -version
      Error occurred during initialization of VM
      Unable to load native library: dlopen(/home/cplummer/macos/lib/libjava.dylib, 1): no suitable image found. Did find:
          /home/cplummer/macos/lib/libjava.dylib: pread of first 4K failed: 14

      $> bin/java -Xss32k -version
      Error occurred during initialization of VM
      Unable to load native library: dlopen(/home/cplummer/macos/lib/libjava.dylib, 1): no suitable image found. Did find:
          /home/cplummer/macos/lib/libjava.dylib: pread of first 4K failed: 14

      $> bin/java -Xss36k -version
      Bus error

      $> bin/java -Xss40k -version
      Bus error

      $> bin/java -Xss44k -version
      The Java thread stack size specified is too small. Specify at least 152k
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.

      So it looks like at least on this machine we need STACK_SIZE_MINIMUM to be more than 40k, and 44k is enough. The behavior differed depending on the machine. The test passed most of the time with 32k. I think maybe just some of the machines require more stack space.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: