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

NewSizeThreadIncrease would make an overflow

    XMLWordPrintable

    Details

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

      Description

      Codes using the flag NewSizeThreadIncrease (size_t) would face an overflow from below cases and we need some guard for that.
      As we calculates with non-daemon threads, flag validation will not work here.

      1. After multiplying non-daemon threads to NewSizeThreadIncrease.
      2. After an addition of desired new size and thread increase.
      3. After 'align_size_up'.

      DefNewGeneration::compute_new_size() {
      ...
        int threads_count = Threads::number_of_non_daemon_threads();
        size_t thread_increase_size = threads_count * NewSizeThreadIncrease;
        desired_new_size = align_size_up(desired_new_size + thread_increase_size, alignment);
      ...
      }

        Attachments

          Activity

            People

            Assignee:
            sangheki Sangheon Kim
            Reporter:
            sangheki Sangheon Kim
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: