1 /* Copyright (c) 2008-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
18 #include "simgrid/sg_config.h"
19 #include "../surf/surf_private.h"
20 #include "../simix/smx_private.h"
22 #include "xbt/automaton.h"
26 #include <libunwind.h>
27 #include <xbt/mmalloc.h>
29 #include "../xbt/mmalloc/mmprivate.h"
30 #include "mc_object_info.h"
31 #include "mc_comm_pattern.h"
32 #include "mc_request.h"
33 #include "mc_safety.h"
34 #include "mc_memory_map.h"
35 #include "mc_snapshot.h"
36 #include "mc_liveness.h"
37 #include "mc_private.h"
41 #include "mc_record.h"
42 #include "mc_protocol.h"
43 #include "mc_client.h"
45 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_global, mc,
46 "Logging specific to MC (global)");
50 double *mc_time = NULL;
53 int user_max_depth_reached = 0;
55 /* MC global data structures */
56 mc_state_t mc_current_state = NULL;
57 char mc_replay_mode = FALSE;
59 __thread mc_comparison_times_t mc_comp_times = NULL;
60 __thread double mc_snapshot_comparison_time;
61 mc_stats_t mc_stats = NULL;
62 mc_global_t initial_global_state = NULL;
63 xbt_fifo_t mc_stack = NULL;
66 xbt_automaton_t _mc_property_automaton = NULL;
69 FILE *dot_output = NULL;
70 const char *colors[13];
73 /******************************* Initialisation of MC *******************************/
74 /*********************************************************************************/
76 static void MC_init_dot_output()
77 { /* FIXME : more colors */
82 colors[3] = "goldenrod";
85 colors[6] = "magenta";
86 colors[7] = "turquoise4";
88 colors[9] = "forestgreen";
89 colors[10] = "hotpink";
90 colors[11] = "lightblue";
93 dot_output = fopen(_sg_mc_dot_output_file, "w");
95 if (dot_output == NULL) {
96 perror("Error open dot output file");
101 "digraph graphname{\n fixedsize=true; rankdir=TB; ranksep=.25; edge [fontsize=12]; node [fontsize=10, shape=circle,width=.5 ]; graph [resolution=20, fontsize=10];\n");
107 MC_init_pid(getpid(), -1);
110 static void MC_init_mode(void)
112 if (mc_mode == MC_MODE_NONE) {
113 if (getenv(MC_ENV_SOCKET_FD)) {
114 mc_mode = MC_MODE_CLIENT;
116 mc_mode = MC_MODE_STANDALONE;
121 void MC_init_pid(pid_t pid, int socket)
123 /* Initialize the data structures that must be persistent across every
124 iteration of the model-checker (in RAW memory) */
126 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
128 mc_model_checker = MC_model_checker_new(pid, socket);
129 if (mc_mode == MC_MODE_SERVER) {
130 unsigned long maxpid;
131 MC_process_read_variable(&mc_model_checker->process, "simix_process_maxpid",
132 &maxpid, sizeof(maxpid));
133 simix_process_maxpid = maxpid;
136 mmalloc_set_current_heap(std_heap);
137 mc_time = xbt_new0(double, MC_smx_get_maxpid());
138 mmalloc_set_current_heap(mc_heap);
140 mc_comp_times = xbt_new0(s_mc_comparison_times_t, 1);
142 /* Initialize statistics */
143 mc_stats = xbt_new0(s_mc_stats_t, 1);
144 mc_stats->state_size = 1;
146 if ((_sg_mc_dot_output_file != NULL) && (_sg_mc_dot_output_file[0] != '\0'))
147 MC_init_dot_output();
150 //parmap = xbt_parmap_mc_new(xbt_os_get_numcores(), XBT_PARMAP_DEFAULT);
154 if (_sg_mc_visited > 0 || _sg_mc_liveness || _sg_mc_termination) {
155 /* Ignore some variables from xbt/ex.h used by exception e for stacks comparison */
156 MC_ignore_local_variable("e", "*");
157 MC_ignore_local_variable("__ex_cleanup", "*");
158 MC_ignore_local_variable("__ex_mctx_en", "*");
159 MC_ignore_local_variable("__ex_mctx_me", "*");
160 MC_ignore_local_variable("__xbt_ex_ctx_ptr", "*");
161 MC_ignore_local_variable("_log_ev", "*");
162 MC_ignore_local_variable("_throw_ctx", "*");
163 MC_ignore_local_variable("ctx", "*");
165 MC_ignore_local_variable("self", "simcall_BODY_mc_snapshot");
166 MC_ignore_local_variable("next_cont"
167 "ext", "smx_ctx_sysv_suspend_serial");
168 MC_ignore_local_variable("i", "smx_ctx_sysv_suspend_serial");
170 /* Ignore local variable about time used for tracing */
171 MC_ignore_local_variable("start_time", "*");
174 MC_ignore_global_variable("mc_model_checker");
175 MC_ignore_global_variable("initial_communications_pattern");
176 MC_ignore_global_variable("incomplete_communications_pattern");
177 MC_ignore_global_variable("nb_comm_pattern");
179 /* MC __thread variables: */
180 MC_ignore_global_variable("mc_diff_info");
181 MC_ignore_global_variable("mc_comp_times");
182 MC_ignore_global_variable("mc_snapshot_comparison_time");
184 /* This MC state is used in MC replay as well: */
185 MC_ignore_global_variable("mc_time");
187 /* Static variable used for tracing */
188 MC_ignore_global_variable("counter");
191 MC_ignore_global_variable("smx_total_comms");
193 if (mc_mode == MC_MODE_STANDALONE || mc_mode == MC_MODE_CLIENT) {
194 /* Those requests are handled on the client side and propagated by message
197 MC_ignore_heap(mc_time, MC_smx_get_maxpid() * sizeof(double));
199 smx_process_t process;
200 xbt_swag_foreach(process, simix_global->process_list) {
201 MC_ignore_heap(&(process->process_hookup), sizeof(process->process_hookup));
207 mmalloc_set_current_heap(heap);
210 /******************************* Core of MC *******************************/
211 /**************************************************************************/
213 static void MC_modelcheck_comm_determinism_init(void)
216 if (mc_mode == MC_MODE_CLIENT) {
217 // This will move somehwere else:
218 MC_client_handle_messages();
221 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
223 /* Create exploration stack */
224 mc_stack = xbt_fifo_new();
228 MC_pre_modelcheck_comm_determinism();
231 initial_global_state = xbt_new0(s_mc_global_t, 1);
232 initial_global_state->snapshot = MC_take_snapshot(0);
233 initial_global_state->initial_communications_pattern_done = 0;
234 initial_global_state->recv_deterministic = 1;
235 initial_global_state->send_deterministic = 1;
236 initial_global_state->recv_diff = NULL;
237 initial_global_state->send_diff = NULL;
241 MC_modelcheck_comm_determinism();
243 mmalloc_set_current_heap(heap);
246 static void MC_modelcheck_liveness_init()
251 if (mc_mode == MC_MODE_CLIENT) {
252 // This will move somehwere else:
253 MC_client_handle_messages();
256 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
258 /* Create exploration stack */
259 mc_stack = xbt_fifo_new();
261 /* Create the initial state */
262 initial_global_state = xbt_new0(s_mc_global_t, 1);
266 MC_pre_modelcheck_liveness();
269 MC_print_statistics(mc_stats);
272 mmalloc_set_current_heap(heap);
276 void MC_do_the_modelcheck_for_real()
280 if (_sg_mc_comms_determinism || _sg_mc_send_determinism) {
281 XBT_INFO("Check communication determinism");
282 mc_reduce_kind = e_mc_reduce_none;
283 MC_modelcheck_comm_determinism_init();
286 else if (!_sg_mc_property_file || _sg_mc_property_file[0] == '\0') {
287 if(_sg_mc_termination)
288 mc_reduce_kind = e_mc_reduce_none;
289 else if (mc_reduce_kind == e_mc_reduce_unset)
290 mc_reduce_kind = e_mc_reduce_dpor;
292 if (mc_mode == MC_MODE_SERVER || mc_mode == MC_MODE_STANDALONE) {
293 if (_sg_mc_termination)
294 XBT_INFO("Check non progressive cycles");
296 XBT_INFO("Check a safety property");
297 MC_wait_for_requests();
298 MC_modelcheck_safety();
301 // Most of this is not needed:
304 MC_client_main_loop();
309 if (mc_reduce_kind == e_mc_reduce_unset)
310 mc_reduce_kind = e_mc_reduce_none;
311 XBT_INFO("Check the liveness property %s", _sg_mc_property_file);
312 MC_automaton_load(_sg_mc_property_file);
313 MC_modelcheck_liveness_init();
326 int MC_deadlock_check()
328 if (mc_mode == MC_MODE_SERVER) {
330 if ((res = MC_protocol_send_simple_message(mc_model_checker->process.socket,
331 MC_MESSAGE_DEADLOCK_CHECK)))
332 xbt_die("Could not check deadlock state");
333 s_mc_int_message_t message;
334 ssize_t s = MC_receive_message(mc_model_checker->process.socket, &message, sizeof(message), 0);
336 xbt_die("Could not receive message");
337 else if (s != sizeof(message) || message.type != MC_MESSAGE_DEADLOCK_CHECK_REPLY) {
338 xbt_die("%s received unexpected message %s (%i, size=%i) "
339 "expected MC_MESSAGE_DEADLOCK_CHECK_REPLY (%i, size=%i)",
340 MC_mode_name(mc_mode),
341 MC_message_type_name(message.type), (int) message.type, (int) s,
342 (int) MC_MESSAGE_DEADLOCK_CHECK_REPLY, (int) sizeof(message)
346 return message.value;
349 int deadlock = FALSE;
350 smx_process_t process;
351 if (xbt_swag_size(simix_global->process_list)) {
353 MC_EACH_SIMIX_PROCESS(process,
354 if (MC_process_is_enabled(process)) {
363 void MC_handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t req, int value, xbt_dynar_t pattern, int backtracking) {
366 case MC_CALL_TYPE_NONE:
368 case MC_CALL_TYPE_SEND:
369 case MC_CALL_TYPE_RECV:
370 MC_get_comm_pattern(pattern, req, call_type, backtracking);
372 case MC_CALL_TYPE_WAIT:
373 case MC_CALL_TYPE_WAITANY:
375 smx_synchro_t current_comm = NULL;
376 if (call_type == MC_CALL_TYPE_WAIT)
377 current_comm = simcall_comm_wait__get__comm(req);
379 current_comm = xbt_dynar_get_as(simcall_comm_waitany__get__comms(req), value, smx_synchro_t);
380 MC_complete_comm_pattern(pattern, current_comm, req->issuer->pid, backtracking);
384 xbt_die("Unexpected call type %i", (int)call_type);
390 * \brief Re-executes from the state at position start all the transitions indicated by
391 * a given model-checker stack.
392 * \param stack The stack with the transitions to execute.
393 * \param start Start index to begin the re-execution.
395 void MC_replay(xbt_fifo_t stack)
397 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
399 int value, count = 1, j;
401 smx_simcall_t req = NULL, saved_req = NULL;
402 xbt_fifo_item_t item, start_item;
405 XBT_DEBUG("**** Begin Replay ****");
407 /* Intermediate backtracking */
408 if(_sg_mc_checkpoint > 0 || _sg_mc_termination || _sg_mc_visited > 0) {
409 start_item = xbt_fifo_get_first_item(stack);
410 state = (mc_state_t)xbt_fifo_get_item_content(start_item);
411 if(state->system_state){
412 MC_restore_snapshot(state->system_state);
413 if(_sg_mc_comms_determinism || _sg_mc_send_determinism)
414 MC_restore_communications_pattern(state);
421 /* Restore the initial state */
422 MC_restore_snapshot(initial_global_state->snapshot);
423 /* At the moment of taking the snapshot the raw heap was set, so restoring
424 * it will set it back again, we have to unset it to continue */
427 start_item = xbt_fifo_get_last_item(stack);
431 if (_sg_mc_comms_determinism || _sg_mc_send_determinism) {
432 for (j=0; j < simix_process_maxpid; j++) {
433 xbt_dynar_reset((xbt_dynar_t)xbt_dynar_get_as(incomplete_communications_pattern, j, xbt_dynar_t));
434 ((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, j, mc_list_comm_pattern_t))->index_comm = 0;
440 /* Traverse the stack from the state at position start and re-execute the transitions */
441 for (item = start_item;
442 item != xbt_fifo_get_first_item(stack);
443 item = xbt_fifo_get_prev_item(item)) {
445 state = (mc_state_t) xbt_fifo_get_item_content(item);
446 saved_req = MC_state_get_executed_request(state, &value);
449 /* because we got a copy of the executed request, we have to fetch the
450 real one, pointed by the request field of the issuer process */
452 const smx_process_t issuer = MC_smx_simcall_get_issuer(saved_req);
453 req = &issuer->simcall;
455 /* Debug information */
456 if (XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)) {
457 req_str = MC_request_to_string(req, value, MC_REQUEST_SIMIX);
458 XBT_DEBUG("Replay: %s (%p)", req_str, state);
462 /* TODO : handle test and testany simcalls */
463 e_mc_call_type_t call = MC_CALL_TYPE_NONE;
464 if (_sg_mc_comms_determinism || _sg_mc_send_determinism)
465 call = MC_get_call_type(req);
467 MC_simcall_handle(req, value);
470 if (_sg_mc_comms_determinism || _sg_mc_send_determinism)
471 MC_handle_comm_pattern(call, req, value, NULL, 1);
474 MC_wait_for_requests();
479 /* Update statistics */
480 mc_stats->visited_states++;
481 mc_stats->executed_transitions++;
485 XBT_DEBUG("**** End Replay ****");
486 mmalloc_set_current_heap(heap);
489 void MC_replay_liveness(xbt_fifo_t stack)
492 initial_global_state->raw_mem_set = (mmalloc_get_current_heap() == mc_heap);
494 xbt_fifo_item_t item;
495 mc_pair_t pair = NULL;
496 mc_state_t state = NULL;
497 smx_simcall_t req = NULL, saved_req = NULL;
498 int value, depth = 1;
501 XBT_DEBUG("**** Begin Replay ****");
503 /* Intermediate backtracking */
504 if(_sg_mc_checkpoint > 0) {
505 item = xbt_fifo_get_first_item(stack);
506 pair = (mc_pair_t) xbt_fifo_get_item_content(item);
507 if(pair->graph_state->system_state){
508 MC_restore_snapshot(pair->graph_state->system_state);
514 /* Restore the initial state */
515 MC_restore_snapshot(initial_global_state->snapshot);
517 /* At the moment of taking the snapshot the raw heap was set, so restoring
518 * it will set it back again, we have to unset it to continue */
519 if (!initial_global_state->raw_mem_set)
522 /* Traverse the stack from the initial state and re-execute the transitions */
523 for (item = xbt_fifo_get_last_item(stack);
524 item != xbt_fifo_get_first_item(stack);
525 item = xbt_fifo_get_prev_item(item)) {
527 pair = (mc_pair_t) xbt_fifo_get_item_content(item);
529 state = (mc_state_t) pair->graph_state;
531 if (pair->exploration_started) {
533 saved_req = MC_state_get_executed_request(state, &value);
535 if (saved_req != NULL) {
536 /* because we got a copy of the executed request, we have to fetch the
537 real one, pointed by the request field of the issuer process */
538 const smx_process_t issuer = MC_smx_simcall_get_issuer(saved_req);
539 req = &issuer->simcall;
541 /* Debug information */
542 if (XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)) {
543 req_str = MC_request_to_string(req, value, MC_REQUEST_SIMIX);
544 XBT_DEBUG("Replay (depth = %d) : %s (%p)", depth, req_str, state);
550 MC_simcall_handle(req, value);
551 MC_wait_for_requests();
554 /* Update statistics */
555 mc_stats->visited_pairs++;
556 mc_stats->executed_transitions++;
562 XBT_DEBUG("**** End Replay ****");
564 if (initial_global_state->raw_mem_set)
572 * \brief Dumps the contents of a model-checker's stack and shows the actual
574 * \param stack The stack to dump
576 void MC_dump_stack_safety(xbt_fifo_t stack)
578 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
580 MC_show_stack_safety(stack);
585 while ((state = (mc_state_t) xbt_fifo_pop(stack)) != NULL)
586 MC_state_delete(state, !state->in_visited_states ? 1 : 0);
587 mmalloc_set_current_heap(heap);
591 void MC_show_stack_safety(xbt_fifo_t stack)
593 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
597 xbt_fifo_item_t item;
599 char *req_str = NULL;
601 for (item = xbt_fifo_get_last_item(stack);
602 (item ? (state = (mc_state_t) (xbt_fifo_get_item_content(item)))
603 : (NULL)); item = xbt_fifo_get_prev_item(item)) {
604 req = MC_state_get_executed_request(state, &value);
606 req_str = MC_request_to_string(req, value, MC_REQUEST_EXECUTED);
607 XBT_INFO("%s", req_str);
612 mmalloc_set_current_heap(heap);
615 void MC_show_deadlock(smx_simcall_t req)
617 /*char *req_str = NULL; */
618 XBT_INFO("**************************");
619 XBT_INFO("*** DEAD-LOCK DETECTED ***");
620 XBT_INFO("**************************");
621 XBT_INFO("Locked request:");
622 /*req_str = MC_request_to_string(req);
623 XBT_INFO("%s", req_str);
624 xbt_free(req_str); */
625 XBT_INFO("Counter-example execution trace:");
626 MC_dump_stack_safety(mc_stack);
627 MC_print_statistics(mc_stats);
630 void MC_show_non_termination(void){
631 XBT_INFO("******************************************");
632 XBT_INFO("*** NON-PROGRESSIVE CYCLE DETECTED ***");
633 XBT_INFO("******************************************");
634 XBT_INFO("Counter-example execution trace:");
635 MC_dump_stack_safety(mc_stack);
636 MC_print_statistics(mc_stats);
640 void MC_show_stack_liveness(xbt_fifo_t stack)
644 xbt_fifo_item_t item;
646 char *req_str = NULL;
648 for (item = xbt_fifo_get_last_item(stack);
649 (item ? (pair = (mc_pair_t) (xbt_fifo_get_item_content(item))) : (NULL));
650 item = xbt_fifo_get_prev_item(item)) {
651 req = MC_state_get_executed_request(pair->graph_state, &value);
652 if (req && req->call != SIMCALL_NONE) {
653 req_str = MC_request_to_string(req, value, MC_REQUEST_EXECUTED);
654 XBT_INFO("%s", req_str);
661 void MC_dump_stack_liveness(xbt_fifo_t stack)
663 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
665 while ((pair = (mc_pair_t) xbt_fifo_pop(stack)) != NULL)
666 MC_pair_delete(pair);
667 mmalloc_set_current_heap(heap);
670 void MC_print_statistics(mc_stats_t stats)
672 if(_sg_mc_comms_determinism) {
673 if (!initial_global_state->recv_deterministic && initial_global_state->send_deterministic){
674 XBT_INFO("******************************************************");
675 XBT_INFO("**** Only-send-deterministic communication pattern ****");
676 XBT_INFO("******************************************************");
677 XBT_INFO("%s", initial_global_state->recv_diff);
678 }else if(!initial_global_state->send_deterministic && initial_global_state->recv_deterministic) {
679 XBT_INFO("******************************************************");
680 XBT_INFO("**** Only-recv-deterministic communication pattern ****");
681 XBT_INFO("******************************************************");
682 XBT_INFO("%s", initial_global_state->send_diff);
686 if (stats->expanded_pairs == 0) {
687 XBT_INFO("Expanded states = %lu", stats->expanded_states);
688 XBT_INFO("Visited states = %lu", stats->visited_states);
690 XBT_INFO("Expanded pairs = %lu", stats->expanded_pairs);
691 XBT_INFO("Visited pairs = %lu", stats->visited_pairs);
693 XBT_INFO("Executed transitions = %lu", stats->executed_transitions);
694 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
695 if ((_sg_mc_dot_output_file != NULL) && (_sg_mc_dot_output_file[0] != '\0')) {
696 fprintf(dot_output, "}\n");
699 if (initial_global_state != NULL && (_sg_mc_comms_determinism || _sg_mc_send_determinism)) {
700 XBT_INFO("Send-deterministic : %s", !initial_global_state->send_deterministic ? "No" : "Yes");
701 if (_sg_mc_comms_determinism)
702 XBT_INFO("Recv-deterministic : %s", !initial_global_state->recv_deterministic ? "No" : "Yes");
704 mmalloc_set_current_heap(heap);
707 void MC_automaton_load(const char *file)
709 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
711 if (_mc_property_automaton == NULL)
712 _mc_property_automaton = xbt_automaton_new();
714 xbt_automaton_load(_mc_property_automaton, file);
715 mmalloc_set_current_heap(heap);
718 static void register_symbol(xbt_automaton_propositional_symbol_t symbol)
720 if (mc_mode != MC_MODE_CLIENT)
722 s_mc_register_symbol_message_t message;
723 message.type = MC_MESSAGE_REGISTER_SYMBOL;
724 const char* name = xbt_automaton_propositional_symbol_get_name(symbol);
725 if (strlen(name) + 1 > sizeof(message.name))
726 xbt_die("Symbol is too long");
727 strncpy(message.name, name, sizeof(message.name));
728 message.callback = xbt_automaton_propositional_symbol_get_callback(symbol);
729 message.data = xbt_automaton_propositional_symbol_get_data(symbol);
730 MC_client_send_message(&message, sizeof(message));
733 void MC_automaton_new_propositional_symbol(const char *id, int(*fct)(void))
735 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
737 if (_mc_property_automaton == NULL)
738 _mc_property_automaton = xbt_automaton_new();
740 xbt_automaton_propositional_symbol_t symbol = xbt_automaton_propositional_symbol_new(_mc_property_automaton, id, fct);
741 register_symbol(symbol);
742 mmalloc_set_current_heap(heap);
745 void MC_automaton_new_propositional_symbol_pointer(const char *id, int* value)
747 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
748 if (_mc_property_automaton == NULL)
749 _mc_property_automaton = xbt_automaton_new();
750 xbt_automaton_propositional_symbol_t symbol = xbt_automaton_propositional_symbol_new_pointer(_mc_property_automaton, id, value);
751 register_symbol(symbol);
752 mmalloc_set_current_heap(heap);
755 void MC_automaton_new_propositional_symbol_callback(const char* id,
756 xbt_automaton_propositional_symbol_callback_type callback,
757 void* data, xbt_automaton_propositional_symbol_free_function_type free_function)
759 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
760 if (_mc_property_automaton == NULL)
761 _mc_property_automaton = xbt_automaton_new();
762 xbt_automaton_propositional_symbol_t symbol = xbt_automaton_propositional_symbol_new_callback(
763 _mc_property_automaton, id, callback, data, free_function);
764 register_symbol(symbol);
765 mmalloc_set_current_heap(heap);
768 // TODO, fix cross-process access (this function is not used)
769 void MC_dump_stacks(FILE* file)
771 xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);
774 stack_region_t current_stack;
776 xbt_dynar_foreach(stacks_areas, cursor, current_stack) {
777 unw_context_t * context = (unw_context_t *)current_stack->context;
778 fprintf(file, "Stack %i:\n", nstack);
783 unw_init_local (&c, context);
786 const char * name = !unw_get_proc_name(&c, buffer, 100, &off) ? buffer : "?";
787 #if defined(__x86_64__)
790 unw_get_reg(&c, UNW_X86_64_RIP, &rip);
791 unw_get_reg(&c, UNW_X86_64_RSP, &rsp);
792 fprintf(file, " %i: %s (RIP=0x%" PRIx64 " RSP=0x%" PRIx64 ")\n",
793 nframe, name, rip, rsp);
795 fprintf(file, " %i: %s\n", nframe, name);
798 } while(unw_step(&c));
802 mmalloc_set_current_heap(heap);
806 double MC_process_clock_get(smx_process_t process)
810 return mc_time[process->pid];
818 void MC_process_clock_add(smx_process_t process, double amount)
820 mc_time[process->pid] += amount;
823 void MC_report_assertion_error(void)
825 XBT_INFO("**************************");
826 XBT_INFO("*** PROPERTY NOT VALID ***");
827 XBT_INFO("**************************");
828 XBT_INFO("Counter-example execution trace:");
829 MC_record_dump_path(mc_stack);
830 MC_dump_stack_safety(mc_stack);
831 MC_print_statistics(mc_stats);