msg_task_t task = MSG_task_create("COMM", 0, 100000000, NULL);
MSG_task_dsend(task, mailbox, task_cleanup_handler);
// We should wait a bit (if not the process will end before the communication, hence an exception on the other side).
- try {
- MSG_process_sleep(30);
- } catch (simgrid::HostFailureException& e) {
+ int res = MSG_process_sleep(30);
+ if (res == MSG_HOST_FAILURE) {
XBT_INFO("The host has died ... as expected.");
}
XBT_INFO(" TX done");
XBT_INFO(" Start RX");
msg_error_t error = MSG_task_receive(&(task), mailbox);
if (error == MSG_OK) {
- XBT_INFO(" Receive message: %s", task->name);
+ XBT_INFO(" Receive message: %s", MSG_task_get_name(task));
MSG_task_destroy(task);
} else if (error == MSG_HOST_FAILURE) {
XBT_INFO(" Receive message: HOST_FAILURE");
test = 6;
if (xbt_dynar_search_or_negative(tests, &test) != -1) {
XBT_INFO("Test 6: Turn on Jupiter, assign a VM on Jupiter, launch a process inside the VM, and turn off the node");
+ MSG_process_set_data_cleanup(nullptr); // If set for test 6, cleanup handler gives double-free errors.
// Create VM0
msg_vm_t vm0 = MSG_vm_create_core(jupiter, "vm0");
MSG_create_environment(argv[1]);
+ MSG_process_set_data_cleanup(task_cleanup_handler);
MSG_process_create("test_launcher", test_launcher, NULL, MSG_get_host_by_name("Tremblay"));
res = MSG_main();