United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6463096 icache invalidation code can segv
6463096 : icache invalidation code can segv

Details
Type:
Bug
Submit Date:
2006-08-23
Status:
Closed
Updated Date:
2012-10-08
Project Name:
JDK
Resolved Date:
2006-11-14
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
hs10

Related Reports
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
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'.

                                    

Comments
EVALUATION

Ok.
                                     
2006-08-23
SUGGESTED FIX

See Description.
                                     
2006-08-23



Hardware and Software, Engineered to Work Together