}
#endif
-#if !SIMGRID_HAVE_MC
-#define _sg_do_model_check 0
-#endif
-
static void _mc_cfg_cb_check(const char* spec, bool more_check = true)
{
if (_sg_cfg_init_status && not _sg_do_model_check && more_check)
if (not process)
xbt_die("Unexpected process (pid:%d).", transition.pid_);
smx_simcall_t simcall = &(process->simcall);
- if (not simcall || simcall->call_ == SIMCALL_NONE)
+ if (simcall == nullptr || simcall->call_ == SIMCALL_NONE)
xbt_die("No simcall for process %d.", transition.pid_);
if (not simgrid::mc::request_is_visible(simcall) || not simgrid::mc::actor_is_enabled(process))
xbt_die("Unexpected simcall.");
State::State(unsigned long state_number) : num_(state_number)
{
this->internal_comm.clear();
- std::memset(&this->internal_req, 0, sizeof(this->internal_req));
- std::memset(&this->executed_req_, 0, sizeof(this->executed_req_));
+ this->internal_req = s_smx_simcall();
+ this->executed_req_ = s_smx_simcall();
actor_states_.resize(MC_smx_get_maxpid());
/* Stateful model checking */
* @brief Represents a simcall to the kernel.
*/
struct s_smx_simcall {
- e_smx_simcall_t call_;
- smx_actor_t issuer_;
- smx_timer_t timeout_cb_; // Callback to timeouts
- simgrid::mc::SimcallInspector* inspector_; // makes that simcall observable by the MC
- int mc_value_;
- u_smx_scalar args_[11];
- u_smx_scalar result_;
+ e_smx_simcall_t call_ = SIMCALL_NONE;
+ smx_actor_t issuer_ = nullptr;
+ smx_timer_t timeout_cb_ = nullptr; // Callback to timeouts
+ simgrid::mc::SimcallInspector* inspector_ = nullptr; // makes that simcall observable by the MC
+ int mc_value_ = 0;
+ u_smx_scalar args_[11] = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
+ u_smx_scalar result_ = {0};
};
#define SIMCALL_SET_MC_VALUE(simcall, value) ((simcall).mc_value_ = (value))
enum { ABORT, ASSERT, PRINTF } behavior;
-/** An (fake) application with a bug occuring for some random values */
+/** A fake application with a bug occuring for some random values */
static void app()
{
int x = MC_random(0, 5);
} else if (strcmp(argv[1], "printf") == 0) {
XBT_INFO("Behavior: printf");
behavior = PRINTF;
+ } else {
+ xbt_die("Please use either 'abort', 'assert' or 'printf' as first parameter, to specify what to do when the error "
+ "is found.");
}
e.load_platform(argv[2]);