-
-/** @brief Run ModelChecker for the user program */
-void ModelChecker::run()
-{
- //Need to initial random number generator state to avoid resets on rollback
- char random_state[256];
- initstate(423121, random_state, sizeof(random_state));
- checkfree = params.checkthreshold;
- for(int exec = 0;exec < params.maxexecutions;exec++) {
- chosen_thread = init_thread;
- thread_chosen = false;
- curr_thread_num = 1;
- thread_id_t tid = int_to_id(1);
- Thread *thr = get_thread(tid);
- switch_from_master(thr);
- finish_execution((exec+1) < params.maxexecutions);
- //restore random number generator state after rollback
- setstate(random_state);
- }
-
- model_print("******* Model-checking complete: *******\n");
- print_stats();
-
- /* Have the trace analyses dump their output. */
- for (unsigned int i = 0;i < trace_analyses.size();i++)
- trace_analyses[i]->finish();
-
- /* unlink tmp file created by last child process */
- char filename[256];
- snprintf_(filename, sizeof(filename), "C11FuzzerTmp%d", getpid());
- unlink(filename);
-}