comparison src/share/vm/services/memSnapshot.cpp @ 8102:fc64254f5579

8008071: Crashed in promote_malloc_records() with Kitchensink after 19 days Summary: Added NULL pointer check for arena size record Reviewed-by: sspitsyn, dholmes
author zgu
date Thu, 21 Feb 2013 07:50:48 -0500
parents ecd24264898b
children c18152e0554e
comparison
equal deleted inserted replaced
8101:b6d5b3e50379 8102:fc64254f5579
526 // a deallocation record 526 // a deallocation record
527 assert(new_rec->is_deallocation_record(), "Sanity check"); 527 assert(new_rec->is_deallocation_record(), "Sanity check");
528 // an arena record can be followed by a size record, we need to remove both 528 // an arena record can be followed by a size record, we need to remove both
529 if (matched_rec->is_arena_record()) { 529 if (matched_rec->is_arena_record()) {
530 MemPointerRecord* next = (MemPointerRecord*)malloc_snapshot_itr.peek_next(); 530 MemPointerRecord* next = (MemPointerRecord*)malloc_snapshot_itr.peek_next();
531 if (next->is_arena_memory_record() && next->is_memory_record_of_arena(matched_rec)) { 531 if (next != NULL && next->is_arena_memory_record() &&
532 next->is_memory_record_of_arena(matched_rec)) {
532 malloc_snapshot_itr.remove(); 533 malloc_snapshot_itr.remove();
533 } 534 }
534 } 535 }
535 // the memory is deallocated, remove related record(s) 536 // the memory is deallocated, remove related record(s)
536 malloc_snapshot_itr.remove(); 537 malloc_snapshot_itr.remove();