Merge branch 'new_fuzzer' of /home/git/random-fuzzer into new_fuzzer
authorroot <root@dw-6.eecs.uci.edu>
Wed, 26 Jun 2019 20:04:49 +0000 (13:04 -0700)
committerroot <root@dw-6.eecs.uci.edu>
Wed, 26 Jun 2019 20:04:49 +0000 (13:04 -0700)
action.h
common.h
model.cc
mymemory.cc
nodestack.h

index 5f7d25c3f38b394e690f2bf946e44fe5ed4eb944..cebbec1beb6ba7d3f409673e92a214b792c8e623 100644 (file)
--- a/action.h
+++ b/action.h
@@ -176,7 +176,7 @@ public:
        /* to accomodate pthread create and join */
        Thread * thread_operand;
        void set_thread_operand(Thread *th) { thread_operand = th; }
-       MEMALLOC
+       SNAPSHOTALLOC
 private:
        const char * get_type_str() const;
        const char * get_mo_str() const;
index 81af78644ac0401a92c61ba20d82fa3711e0f401..01426a4d66bee75772507710221b3a99a02c49f0 100644 (file)
--- a/common.h
+++ b/common.h
@@ -32,7 +32,7 @@ void assert_hook(void);
                        fprintf(stderr, "Error: assertion failed in %s at line %d\n", __FILE__, __LINE__); \
                        /* print_trace(); // Trace printing may cause dynamic memory allocation */ \
                        assert_hook();                           \
-                       exit(EXIT_FAILURE); \
+                       _Exit(EXIT_FAILURE); \
                } \
        } while (0)
 #else
index 4b159aa5d35f879da883571c0bbc203d68a1c6d5..c468d0deb3e8b6972673d3910670e99eff42052f 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -64,8 +64,6 @@ void ModelChecker::setParams(struct model_params params) {
  */
 void ModelChecker::reset_to_initial_state()
 {
-       DEBUG("+++ Resetting to initial state +++\n");
-       node_stack->reset_execution();
 
        /**
         * FIXME: if we utilize partial rollback, we will need to free only
@@ -263,7 +261,6 @@ bool ModelChecker::next_execution()
 // test code
        execution_number++;
        reset_to_initial_state();
-       node_stack->full_reset();
        return false;
 }
 
@@ -359,7 +356,6 @@ void ModelChecker::do_restart()
 {
        restart_flag = false;
        reset_to_initial_state();
-       node_stack->full_reset();
        memset(&stats,0,sizeof(struct execution_stats));
        execution_number = 1;
 }
index f7b716247e3965d5b2c2f3e255846b60aeda01c5..84600ae9d39ebac840d9cfe606bb5b030778b170 100644 (file)
@@ -74,7 +74,7 @@ void *model_malloc(size_t size)
 /** @brief Snapshotting malloc, for use by model-checker (not user progs) */
 void * snapshot_malloc(size_t size)
 {
-       void *tmp = mspace_malloc(model_snapshot_space, size);
+       void *tmp = malloc(size);
        ASSERT(tmp);
        return tmp;
 }
@@ -82,7 +82,7 @@ void * snapshot_malloc(size_t size)
 /** @brief Snapshotting calloc, for use by model-checker (not user progs) */
 void * snapshot_calloc(size_t count, size_t size)
 {
-       void *tmp = mspace_calloc(model_snapshot_space, count, size);
+       void *tmp = calloc(count, size);
        ASSERT(tmp);
        return tmp;
 }
@@ -90,7 +90,7 @@ void * snapshot_calloc(size_t count, size_t size)
 /** @brief Snapshotting realloc, for use by model-checker (not user progs) */
 void *snapshot_realloc(void *ptr, size_t size)
 {
-       void *tmp = mspace_realloc(model_snapshot_space, ptr, size);
+       void *tmp = realloc(ptr, size);
        ASSERT(tmp);
        return tmp;
 }
@@ -98,7 +98,7 @@ void *snapshot_realloc(void *ptr, size_t size)
 /** @brief Snapshotting free, for use by model-checker (not user progs) */
 void snapshot_free(void *ptr)
 {
-       mspace_free(model_snapshot_space, ptr);
+       free(ptr);
 }
 
 /** Non-snapshotting free for our use. */
index fa356d0e9ae666db61bb993423b7b915df2c815b..09a79e4057d882431b9e662373c2b3a19bfff5fb 100644 (file)
@@ -32,7 +32,7 @@ public:
        ModelAction * get_uninit_action() const { return uninit_action; }
        void print() const;
 
-       MEMALLOC
+       SNAPSHOTALLOC
 private:
        ModelAction * const action;
 
@@ -40,7 +40,7 @@ private:
        ModelAction *uninit_action;
 };
 
-typedef ModelVector<Node *> node_list_t;
+typedef SnapVector<Node *> node_list_t;
 
 /**
  * @brief A stack of nodes
@@ -63,7 +63,7 @@ public:
        void full_reset();
        void print() const;
 
-       MEMALLOC
+       SNAPSHOTALLOC
 private:
        node_list_t node_list;
        const struct model_params * get_params() const;