6953058: G1: A bigapp crashes with SIGSEGV in compiled code

Mon, 07 Jun 2010 17:46:04 -0700

author
johnc
date
Mon, 07 Jun 2010 17:46:04 -0700
changeset 1948
2458a1f25356
parent 1947
5b77884bd4b7
child 1949
b9bc732be7c0

6953058: G1: A bigapp crashes with SIGSEGV in compiled code
Summary: In C2's G1 post write barrier, the loads of the buffer and index fields from the DirtyCardQueue structure may be moved across a safepoint. Use the current value of "control" in the C2 IR to limit how far these loads can move.
Reviewed-by: never, iveresov, kvn

src/share/vm/opto/graphKit.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/opto/graphKit.cpp	Thu May 27 13:09:56 2010 -0700
     1.2 +++ b/src/share/vm/opto/graphKit.cpp	Mon Jun 07 17:46:04 2010 -0700
     1.3 @@ -3487,7 +3487,6 @@
     1.4  
     1.5    Node* tls = __ thread(); // ThreadLocalStorage
     1.6  
     1.7 -  Node* no_ctrl = NULL;
     1.8    Node* no_base = __ top();
     1.9    float likely  = PROB_LIKELY(0.999);
    1.10    float unlikely  = PROB_UNLIKELY(0.999);
    1.11 @@ -3511,10 +3510,10 @@
    1.12    Node* index_adr =  __ AddP(no_base, tls, __ ConX(index_offset));
    1.13  
    1.14    // Now some values
    1.15 -
    1.16 -  Node* index  = __ load(no_ctrl, index_adr, TypeInt::INT, T_INT, Compile::AliasIdxRaw);
    1.17 -  Node* buffer = __ load(no_ctrl, buffer_adr, TypeRawPtr::NOTNULL, T_ADDRESS, Compile::AliasIdxRaw);
    1.18 -
    1.19 +  // Use ctrl to avoid hoisting these values past a safepoint, which could
    1.20 +  // potentially reset these fields in the JavaThread.
    1.21 +  Node* index  = __ load(__ ctrl(), index_adr, TypeInt::INT, T_INT, Compile::AliasIdxRaw);
    1.22 +  Node* buffer = __ load(__ ctrl(), buffer_adr, TypeRawPtr::NOTNULL, T_ADDRESS, Compile::AliasIdxRaw);
    1.23  
    1.24    // Convert the store obj pointer to an int prior to doing math on it
    1.25    // Must use ctrl to prevent "integerized oop" existing across safepoint

mercurial