8358632: [asan] reports heap-buffer-overflow in AOTCodeCache::copy_bytes
Reviewed-by: vlivanov, iveresov
This commit is contained in:
parent
575806c0e5
commit
849655a145
@ -460,18 +460,9 @@ AOTCodeCache* AOTCodeCache::open_for_dump() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void copy_bytes(const char* from, address to, uint size) {
|
void copy_bytes(const char* from, address to, uint size) {
|
||||||
assert(size > 0, "sanity");
|
assert((int)size > 0, "sanity");
|
||||||
bool by_words = true;
|
memcpy(to, from, size);
|
||||||
if ((size > 2 * HeapWordSize) && (((intptr_t)from | (intptr_t)to) & (HeapWordSize - 1)) == 0) {
|
log_trace(aot, codecache)("Copied %d bytes from " INTPTR_FORMAT " to " INTPTR_FORMAT, size, p2i(from), p2i(to));
|
||||||
// Use wordwise copies if possible:
|
|
||||||
Copy::disjoint_words((HeapWord*)from,
|
|
||||||
(HeapWord*)to,
|
|
||||||
((size_t)size + HeapWordSize-1) / HeapWordSize);
|
|
||||||
} else {
|
|
||||||
by_words = false;
|
|
||||||
Copy::conjoint_jbytes(from, to, (size_t)size);
|
|
||||||
}
|
|
||||||
log_trace(aot, codecache)("Copied %d bytes as %s from " INTPTR_FORMAT " to " INTPTR_FORMAT, size, (by_words ? "HeapWord" : "bytes"), p2i(from), p2i(to));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AOTCodeReader::AOTCodeReader(AOTCodeCache* cache, AOTCodeEntry* entry) {
|
AOTCodeReader::AOTCodeReader(AOTCodeCache* cache, AOTCodeEntry* entry) {
|
||||||
|
@ -173,7 +173,7 @@ public class AOTCodeCompressedOopsTest {
|
|||||||
* [0.022s][info][cds] narrow_oop_mode = 3, narrow_oop_base = 0x0000000300000000, narrow_oop_shift = 3
|
* [0.022s][info][cds] narrow_oop_mode = 3, narrow_oop_base = 0x0000000300000000, narrow_oop_shift = 3
|
||||||
* [0.022s][info][cds] heap range = [0x0000000301000000 - 0x0000000ac1000000]
|
* [0.022s][info][cds] heap range = [0x0000000301000000 - 0x0000000ac1000000]
|
||||||
*/
|
*/
|
||||||
Pattern p = Pattern.compile("narrow_oop_base = 0x(\\d+), narrow_oop_shift = (\\d)");
|
Pattern p = Pattern.compile("narrow_oop_base = 0x([0-9a-fA-F]+), narrow_oop_shift = (\\d)");
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
String line = list.get(i);
|
String line = list.get(i);
|
||||||
if (line.indexOf("CDS archive was created with max heap size") != -1) {
|
if (line.indexOf("CDS archive was created with max heap size") != -1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user