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)