Ticket #8453: 0001-Fix-a-race-condition-when-PROFILING-8453.patch

File 0001-Fix-a-race-condition-when-PROFILING-8453.patch, 1.3 KB (added by akio, 6 months ago)

patch to fix assertion failure

  • rts/sm/Evac.c

    From 155b7344c89fb78de778d23aa27a0a8b9c800194 Mon Sep 17 00:00:00 2001
    From: Takano Akio <aljee@hyper.cx>
    Date: Thu, 17 Oct 2013 22:50:43 +0900
    Subject: [PATCH] Fix a race condition when PROFILING (#8453)
    
    ---
     rts/sm/Evac.c | 12 +++++++++---
     1 file changed, 9 insertions(+), 3 deletions(-)
    
    diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c
    index 223e2f3..577edc3 100644
    a b selector_loop: 
    955955#ifdef PROFILING 
    956956              // For the purposes of LDV profiling, we have destroyed 
    957957              // the original selector thunk, p. 
    958               SET_INFO((StgClosure*)p, (StgInfoTable *)info_ptr); 
    959               OVERWRITING_CLOSURE((StgClosure*)p); 
    960               SET_INFO((StgClosure*)p, &stg_WHITEHOLE_info); 
     958              if (era > 0) { 
     959                  // Only modify the info pointer when LDV profiling is 
     960                  // enabled.  Note that this is incompatible with parallel GC, 
     961                  // because it would allow other threads to start evaluating 
     962                  // the same selector thunk. 
     963                  SET_INFO((StgClosure*)p, (StgInfoTable *)info_ptr); 
     964                  OVERWRITING_CLOSURE((StgClosure*)p); 
     965                  SET_INFO((StgClosure*)p, &stg_WHITEHOLE_info); 
     966              } 
    961967#endif 
    962968 
    963969              // the closure in val is now the "value" of the