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

icache invalidation code can segv

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • hs10
    • 6
    • hotspot
    • None
    • b03
    • generic
    • generic

        The code to invalidate a word (defined to be 4 bytes) in the icache in icache.cpp
        can segv if

        1. The word is the last word in it's line.

        2. The line is the last one in its mapped memory segment (e.g., the code cache).

        The bad code is in

        void AbstractICache::invalidate_word(address addr) {
          // Because this is called for instruction patching on the fly,
          // long after bootstrapping, we execute the stub directly.
          // Account for a 4-byte word spanning two cache lines.
          intptr_t start_line = ((intptr_t)addr + 0) & ~(ICache::line_size - 1);
          intptr_t end_line = ((intptr_t)addr + 4) & ~(ICache::line_size - 1);
          (*_flush_icache_stub)((address)start_line, start_line == end_line ? 1 : 2, 0);
        }

        '4' should be '3'.

              phh Paul Hohensee
              phh Paul Hohensee
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: