Skip to content

Commit

Permalink
8246369: CodeCache.findBlobUnsafe(addr) sometimes asserts with valid …
Browse files Browse the repository at this point in the history
…address

Reviewed-by: sspitsyn, amenkov
  • Loading branch information
plummercj committed Jun 17, 2020
1 parent 1cb5a48 commit 07f9376
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -132,11 +132,13 @@ public CodeBlob findBlobUnsafe(Address start) {
}
if (result == null) return null;
if (Assert.ASSERTS_ENABLED) {
// The HeapBlock that contains this blob is outside of the blob
// but it shouldn't be an error to find a blob based on the
// pointer to the HeapBlock.
Assert.that(result.blobContains(start) || result.blobContains(start.addOffsetTo(8)),
"found wrong CodeBlob");
// The pointer to the HeapBlock that contains this blob is outside of the blob,
// but it shouldn't be an error to find a blob based on the pointer to the HeapBlock.
// The heap block header is padded out to an 8-byte boundary. See heap.hpp. The
// simplest way to compute the header size is just 2 * addressSize.
Assert.that(result.blobContains(start) ||
result.blobContains(start.addOffsetTo(2 * VM.getVM().getAddressSize())),
"found wrong CodeBlob");
}
return result;
}
Expand Down

0 comments on commit 07f9376

Please sign in to comment.