Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
It was more difficult to find the bug that I thought, but it seems working now.
[simgrid.git] / src / gras / Msg / msg.c
index f1f89a4..b24b4c5 100644 (file)
@@ -40,6 +40,7 @@ static void *gras_msg_procdata_new() {
    res->cbl_list      = xbt_dynar_new(sizeof(gras_cblist_t *),gras_cbl_free);
    res->timers        = xbt_dynar_new(sizeof(s_gras_timer_t), NULL);
    res->msg_to_receive_queue = xbt_fifo_new();
+   res->msg_to_receive_queue_meas = xbt_fifo_new();
    
    return (void*)res;
 }
@@ -55,6 +56,7 @@ static void gras_msg_procdata_free(void *data) {
    xbt_dynar_free(&( res->cbl_list ));
    xbt_dynar_free(&( res->timers ));
    xbt_fifo_free( res->msg_to_receive_queue );
+   xbt_fifo_free( res->msg_to_receive_queue_meas );
 
    free(res->name);
    free(res);
@@ -684,8 +686,14 @@ gras_msg_handle(double timeOut) {
     } CATCH(e) {
       free(msg.payl);
       if (msg.type->kind == e_gras_msg_kind_rpccall) {
+       char *old_file=e.file;
        /* The callback raised an exception, propagate it on the network */
-       if (!e.remote) { /* the exception is born on this machine */
+       if (!e.remote) { 
+         /* Make sure we reduce the file name to its basename to avoid issues in tests */
+         char *new_file=strrchr(e.file,'/');
+         if (new_file)
+            e.file = new_file;
+         /* the exception is born on this machine */
          e.host = (char*)gras_os_myname();
          xbt_ex_setup_backtrace(&e);
        } 
@@ -697,6 +705,7 @@ gras_msg_handle(double timeOut) {
              gras_socket_peer_port(msg.expe));
        gras_msg_send_ext(msg.expe, e_gras_msg_kind_rpcerror,
                          msg.ID, msg.type, &e);
+       e.file=old_file;
        xbt_ex_free(e);
        ctx.answer_due = 0;
        ran_ok=1;