From: root Date: Mon, 29 Jul 2019 04:07:16 +0000 (-0700) Subject: bug fix X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=c87eadb9d625748d6bfc00df9195f851d791d96a bug fix --- diff --git a/cyclegraph.cc b/cyclegraph.cc index 7cfd21c8..966a5035 100644 --- a/cyclegraph.cc +++ b/cyclegraph.cc @@ -138,7 +138,7 @@ void CycleGraph::addRMWEdge(const ModelAction *from, const ModelAction *rmw) } void CycleGraph::addEdges(SnapList * edgeset, const ModelAction *to) { - for(SnapList::iterator it = edgeset->begin();it!=edgeset->end();) { + for(SnapList::iterator it = edgeset->begin();it!=edgeset->end();) { ModelAction *act = *it; CycleNode *node = getNode(act); SnapList::iterator it2 = it; @@ -147,11 +147,11 @@ void CycleGraph::addEdges(SnapList * edgeset, const ModelAction * ModelAction *act2 = *it2; CycleNode *node2 = getNode(act2); if (checkReachable(node, node2)) { - it = edgeset->erase(it); - goto endouterloop; + it = edgeset->erase(it); + goto endouterloop; } else if (checkReachable(node2, node)) { - it2 = edgeset->erase(it2); - goto endinnerloop; + it2 = edgeset->erase(it2); + goto endinnerloop; } it2++; endinnerloop: @@ -160,8 +160,8 @@ endinnerloop: it++; endouterloop: ; - } - for(SnapList::iterator it = edgeset->begin();it!=edgeset->end();it++) { + } + for(SnapList::iterator it = edgeset->begin();it!=edgeset->end();it++) { ModelAction *from = *it; addEdge(from, to, from->get_tid() == to->get_tid()); } diff --git a/execution.cc b/execution.cc index c07db8e9..290a2624 100644 --- a/execution.cc +++ b/execution.cc @@ -919,6 +919,8 @@ void ModelExecution::w_modification_order(ModelAction *curr) if (last_seq_cst != NULL) { edgeset.push_back(last_seq_cst); } + //update map for next query + obj_last_sc_map.put(curr->get_location(), curr); } /* Last SC fence in the current thread */ @@ -1207,10 +1209,6 @@ void ModelExecution::add_normal_write_to_lists(ModelAction *act) void ModelExecution::add_write_to_lists(ModelAction *write) { - // Update seq_cst map - if (write->is_seqcst()) - obj_last_sc_map.put(write->get_location(), write); - SnapVector *vec = get_safe_ptr_vect_action(&obj_wr_thrd_map, write->get_location()); int tid = id_to_int(write->get_tid()); if (tid >= (int)vec->size()) diff --git a/history.cc b/history.cc index 4c0c4f52..ca176b19 100644 --- a/history.cc +++ b/history.cc @@ -126,8 +126,8 @@ void ModelHistory::process_action(ModelAction *act, thread_id_t tid) if (inst == NULL) return; - if (inst->is_read()) - func_node->store_read(act, tid); + // if (inst->is_read()) + // func_node->store_read(act, tid); /* add to curr_inst_list */ func_inst_list_t * curr_inst_list = func_inst_lists->back(); diff --git a/threads.cc b/threads.cc index cb814fc5..8b3e0c61 100644 --- a/threads.cc +++ b/threads.cc @@ -93,7 +93,7 @@ void thread_startup() } #ifdef TLS -static int (*pthread_mutex_init_p) (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr) = NULL; +static int (*pthread_mutex_init_p)(pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr) = NULL; int real_pthread_mutex_init(pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr) { return pthread_mutex_init_p(__mutex, __mutexattr); @@ -207,7 +207,7 @@ void setup_context() { model->switch_to_master(new ModelAction(THREAD_START, std::memory_order_seq_cst, curr_thread)); real_init_all(); - + /* Initialize our lock */ real_pthread_mutex_init(&curr_thread->mutex, NULL); real_pthread_mutex_init(&curr_thread->mutex2, NULL);