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

Reserving more stack space for overflow handling

XMLWordPrintable

    • 15
    • sparc
    • solaris_8

      Customer is seeing crashes due to stack overflow. Need to re analyse the
      current buffer zone:

      src/solaris/hpi/native_threads/include/threads_md.h

      /*
       * sysThreadCheckStack() being a function call is unfortunate, as it
       * takes stack space to do, but that is weakly accounted for by the
       * previous stack redzone. In general, where we can't predict stack
       * use by C, thread stack overflow checking doesn't really work.
       *
       * The value of STACK_REDZONE determines how much room must remain on the
       * stack for sysThreadCheckStack() to declare success.
       *
       * At first glance it might appear that sysThreadCheckStack could be
       * implemented in terms of sysThreadCheckStack0. However, that would add
       * another stack frame and distort the check.
       *
       * Note also that these functions rely on local variables and parameters being
       * allocated on the stack, so that taking their address reveals how deep the
       * stack has grown.
       */

      #ifdef DEBUG
      #define STACK_REDZONE 0x1800 /* should be a multiple of 1K, see JITPass2.c */
      #else
      #define STACK_REDZONE 0x1000 /* should be at most 4k, see JITPass2.c */
      #endif

            chrisphi Chris Phillips
            chrisphi Chris Phillips
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: