提交 2c2c1d9c 编写于 作者: T tonyp

7040450: G1: assert((_g1->evacuation_failed()) || (!_g1->obj_in_cs(obj)))...

7040450: G1: assert((_g1->evacuation_failed()) || (!_g1->obj_in_cs(obj))) failed: shouldn't still be in ...
Summary: There is a race in the evac failure handling code that causes the condition the assert checks not to be true. The fix is to replace the too-strong assert with a more targeted one.
Reviewed-by: johnc, ysr, jcoomes
上级 b021a51f
...@@ -3975,6 +3975,9 @@ void G1CollectedHeap::drain_evac_failure_scan_stack() { ...@@ -3975,6 +3975,9 @@ void G1CollectedHeap::drain_evac_failure_scan_stack() {
oop oop
G1CollectedHeap::handle_evacuation_failure_par(OopsInHeapRegionClosure* cl, G1CollectedHeap::handle_evacuation_failure_par(OopsInHeapRegionClosure* cl,
oop old) { oop old) {
assert(obj_in_cs(old),
err_msg("obj: "PTR_FORMAT" should still be in the CSet",
(HeapWord*) old));
markOop m = old->mark(); markOop m = old->mark();
oop forward_ptr = old->forward_to_atomic(old); oop forward_ptr = old->forward_to_atomic(old);
if (forward_ptr == NULL) { if (forward_ptr == NULL) {
...@@ -3997,7 +4000,13 @@ G1CollectedHeap::handle_evacuation_failure_par(OopsInHeapRegionClosure* cl, ...@@ -3997,7 +4000,13 @@ G1CollectedHeap::handle_evacuation_failure_par(OopsInHeapRegionClosure* cl,
} }
return old; return old;
} else { } else {
// Someone else had a place to copy it. // Forward-to-self failed. Either someone else managed to allocate
// space for this object (old != forward_ptr) or they beat us in
// self-forwarding it (old == forward_ptr).
assert(old == forward_ptr || !obj_in_cs(forward_ptr),
err_msg("obj: "PTR_FORMAT" forwarded to: "PTR_FORMAT" "
"should not be in the CSet",
(HeapWord*) old, (HeapWord*) forward_ptr));
return forward_ptr; return forward_ptr;
} }
} }
...@@ -4308,11 +4317,10 @@ template <class T> void G1ParCopyHelper::mark_forwardee(T* p) { ...@@ -4308,11 +4317,10 @@ template <class T> void G1ParCopyHelper::mark_forwardee(T* p) {
T heap_oop = oopDesc::load_heap_oop(p); T heap_oop = oopDesc::load_heap_oop(p);
if (!oopDesc::is_null(heap_oop)) { if (!oopDesc::is_null(heap_oop)) {
oop obj = oopDesc::decode_heap_oop(heap_oop); oop obj = oopDesc::decode_heap_oop(heap_oop);
assert((_g1->evacuation_failed()) || (!_g1->obj_in_cs(obj)),
"shouldn't still be in the CSet if evacuation didn't fail.");
HeapWord* addr = (HeapWord*)obj; HeapWord* addr = (HeapWord*)obj;
if (_g1->is_in_g1_reserved(addr)) if (_g1->is_in_g1_reserved(addr)) {
_cm->grayRoot(oop(addr)); _cm->grayRoot(oop(addr));
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册