6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on

Rewrite frame::safe_for_sender and friends to be safe for collector/analyzer

Reviewed-by: dcubed, kvn
This commit is contained in:
Steve Goldman 2008-04-08 12:23:15 -04:00
parent bfbfdfa428
commit c89e39d40a
13 changed files with 861 additions and 673 deletions

View file

@ -71,7 +71,22 @@ class CodeCache : AllStatic {
// what you are doing)
static CodeBlob* find_blob_unsafe(void* start) {
CodeBlob* result = (CodeBlob*)_heap->find_start(start);
assert(result == NULL || result->blob_contains((address)start), "found wrong CodeBlob");
// this assert is too strong because the heap code will return the
// heapblock containing start. That block can often be larger than
// the codeBlob itself. If you look up an address that is within
// the heapblock but not in the codeBlob you will assert.
//
// Most things will not lookup such bad addresses. However
// AsyncGetCallTrace can see intermediate frames and get that kind
// of invalid address and so can a developer using hsfind.
//
// The more correct answer is to return NULL if blob_contains() returns
// false.
// assert(result == NULL || result->blob_contains((address)start), "found wrong CodeBlob");
if (result != NULL && !result->blob_contains((address)start)) {
result = NULL;
}
return result;
}