From: weiyu Date: Sun, 10 Nov 2019 21:55:25 +0000 (-0800) Subject: Avoid seg fault in the case where ensureModel is called in cds_func_entry and then... X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=bb18310b8c8c97d8e396940bdfee740bd6d3e30a;hp=f2370e62cde5daffcd0a75c0e95b2050ed63d414 Avoid seg fault in the case where ensureModel is called in cds_func_entry and then a normal memory access comes before first recorded ModelAction --- diff --git a/datarace.cc b/datarace.cc index 58c52dd6..dd88c2fe 100644 --- a/datarace.cc +++ b/datarace.cc @@ -256,6 +256,9 @@ void raceCheckWrite(thread_id_t thread, void *location) uint64_t *shadow = lookupAddressEntry(location); uint64_t shadowval = *shadow; ClockVector *currClock = get_execution()->get_cv(thread); + if (currClock == NULL) + return; + struct DataRace * race = NULL; /* Do full record */ if (shadowval != 0 && !ISSHORTRECORD(shadowval)) { @@ -424,6 +427,9 @@ void raceCheckRead(thread_id_t thread, const void *location) uint64_t *shadow = lookupAddressEntry(location); uint64_t shadowval = *shadow; ClockVector *currClock = get_execution()->get_cv(thread); + if (currClock == NULL) + return; + struct DataRace * race = NULL; /* Do full record */