void MC_init_memory_map_info(){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
MC_SET_RAW_MEM;
mc_snapshot_t MC_take_snapshot_liveness()
{
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
-
+ int raw_mem = (mmalloc_get_current_heap() == raw_heap);
+
MC_SET_RAW_MEM;
mc_snapshot_t snapshot = xbt_new0(s_mc_snapshot_t, 1);
MC_UNSET_RAW_MEM;
- if(raw_mem_set)
+ if(raw_mem)
MC_SET_RAW_MEM;
return snapshot;
int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2, mc_comparison_times_t ct1, mc_comparison_times_t ct2){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem = (mmalloc_get_current_heap() == raw_heap);
MC_SET_RAW_MEM;
-
+
int errors = 0, i = 0;
if(s1->num_reg != s2->num_reg){
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_verbose)){
XBT_VERB("Different num_reg (s1 = %u, s2 = %u)", s1->num_reg, s2->num_reg);
}
+ if(!raw_mem)
+ MC_UNSET_RAW_MEM;
return 1;
}
xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
- if(!raw_mem_set)
+ if(!raw_mem)
MC_UNSET_RAW_MEM;
return 1;
xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
- if(!raw_mem_set)
+ if(!raw_mem)
MC_UNSET_RAW_MEM;
return 1;
xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
- if(!raw_mem_set)
+ if(!raw_mem)
MC_UNSET_RAW_MEM;
return 1;
}
xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
- if(!raw_mem_set)
+ if(!raw_mem)
MC_UNSET_RAW_MEM;
return 1;
}
xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
- if(!raw_mem_set)
+ if(!raw_mem)
MC_UNSET_RAW_MEM;
return 1;
}
xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
- if(!raw_mem_set)
+ if(!raw_mem)
MC_UNSET_RAW_MEM;
return 1;
}
xbt_os_timer_free(global_timer);
- if(!raw_mem_set)
+ if(!raw_mem)
MC_UNSET_RAW_MEM;
return errors > 0;
void MC_dpor_init()
{
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
mc_state_t initial_state = NULL;
smx_process_t process;
void MC_dpor(void)
{
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
-
char *req_str;
int value;
smx_simcall_t req = NULL, prev_req = NULL;
}
}
MC_print_statistics(mc_stats);
- MC_UNSET_RAW_MEM;
-
- if(raw_mem_set)
- MC_SET_RAW_MEM;
- else
- MC_UNSET_RAW_MEM;
-
+ MC_UNSET_RAW_MEM;
return;
}
char mc_replay_mode = FALSE;
double *mc_time = NULL;
mc_snapshot_t initial_snapshot = NULL;
-int raw_mem_set;
/* Safety */
void MC_init_safety(void)
{
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
/* Check if MC is already initialized */
if (initial_snapshot)
void MC_init_liveness(){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
mc_time = xbt_new0(double, simix_process_maxpid);
void MC_modelcheck_liveness(){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
MC_init_liveness();
MC_print_statistics_pairs(mc_stats_pair);
xbt_free(mc_time);
+ if(raw_mem_set)
+ MC_SET_RAW_MEM;
+
}
void MC_replay_liveness(xbt_fifo_t stack, int all_stack)
{
- int raw_mem = (mmalloc_get_current_heap() == raw_heap);
+ initial_state_liveness->raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
int value;
char *req_str;
XBT_DEBUG("**** Begin Replay ****");
/* Restore the initial state */
- MC_restore_snapshot(initial_state_liveness->initial_snapshot);
+ MC_restore_snapshot(initial_state_liveness->snapshot);
+
/* At the moment of taking the snapshot the raw heap was set, so restoring
* it will set it back again, we have to unset it to continue */
-
- MC_UNSET_RAW_MEM;
+ if(!initial_state_liveness->raw_mem_set)
+ MC_UNSET_RAW_MEM;
if(all_stack){
XBT_DEBUG("**** End Replay ****");
- if(raw_mem)
+ if(initial_state_liveness->raw_mem_set)
MC_SET_RAW_MEM;
else
MC_UNSET_RAW_MEM;
void MC_dump_stack_safety(xbt_fifo_t stack)
{
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
MC_show_stack_safety(stack);
void MC_dump_stack_liveness(xbt_fifo_t stack){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
mc_pair_stateless_t pair;
void MC_automaton_load(const char *file){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
MC_SET_RAW_MEM;
void MC_automaton_new_propositional_symbol(const char* id, void* fct) {
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
MC_SET_RAW_MEM;
void MC_ignore_heap(void *address, size_t size){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
MC_SET_RAW_MEM;
void MC_ignore_data_bss(void *address, size_t size){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
MC_SET_RAW_MEM;
void MC_ignore_stack(const char *var_name, const char *frame){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
MC_SET_RAW_MEM;
void MC_new_stack_area(void *stack, char *name, void* context, size_t size){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
MC_SET_RAW_MEM;
if(stacks_areas == NULL)
int reached(xbt_state_t st){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
MC_SET_RAW_MEM;
void set_pair_reached(xbt_state_t st){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
MC_SET_RAW_MEM;
void MC_ddfs_init(void){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ initial_state_liveness->raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
XBT_INFO("**************************************************");
XBT_INFO("Double-DFS init");
successors = xbt_dynar_new(sizeof(mc_pair_stateless_t), NULL);
/* Save the initial state */
- initial_state_liveness->initial_snapshot = MC_take_snapshot_liveness();
+ initial_state_liveness->snapshot = MC_take_snapshot_liveness();
MC_UNSET_RAW_MEM;
MC_UNSET_RAW_MEM;
if(cursor != 0){
- MC_restore_snapshot(initial_state_liveness->initial_snapshot);
+ MC_restore_snapshot(initial_state_liveness->snapshot);
MC_UNSET_RAW_MEM;
}
set_pair_reached(state);
if(cursor != 0){
- MC_restore_snapshot(initial_state_liveness->initial_snapshot);
+ MC_restore_snapshot(initial_state_liveness->snapshot);
MC_UNSET_RAW_MEM;
}
}
}
- if(raw_mem_set)
+ if(initial_state_liveness->raw_mem_set)
MC_SET_RAW_MEM;
else
MC_UNSET_RAW_MEM;
void MC_ddfs(int search_cycle){
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ //initial_state_liveness->raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
smx_process_t process;
mc_pair_stateless_t current_pair = NULL;
}
MC_UNSET_RAW_MEM;
- if(raw_mem_set)
- MC_SET_RAW_MEM;
+ /*if(initial_state_liveness->raw_mem_set)
+ MC_SET_RAW_MEM;*/
}
}s_mc_snapshot_stack_t, *mc_snapshot_stack_t;
typedef struct s_mc_global_t{
- mc_snapshot_t initial_snapshot;
+ mc_snapshot_t snapshot;
+ int raw_mem_set;
}s_mc_global_t, *mc_global_t;
void MC_take_snapshot(mc_snapshot_t);
#define MC_SET_RAW_MEM mmalloc_set_current_heap(raw_heap)
#define MC_UNSET_RAW_MEM mmalloc_set_current_heap(std_heap)
-extern int raw_mem_set;
-
/******************************* MEMORY MAPPINGS ***************************/
/* These functions and data structures implements a binary interface for */
/* the proc maps ascii interface */