Change 'exit' from RPC to message in if/proc_mgmt.if.
authorRazvan Damachi <damachir@emmentaler2.ethz.ch>
Fri, 25 Aug 2017 14:31:12 +0000 (16:31 +0200)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Thu, 31 Aug 2017 14:35:10 +0000 (16:35 +0200)
Having 'exit' as an RPC caused a bug where the client's capabilities were
revoked while it was waiting for a response to RPC exit, causing the UMP
driver to throw a cap_transfer error in the client's monitor.

Signed-off-by: Razvan Damachi <razvan.damachi@gmail.com>

if/proc_mgmt.if
lib/barrelfish/proc_mgmt_client.c
usr/proc_mgmt/service.c

index b2d1644..7c53aa3 100644 (file)
@@ -39,10 +39,8 @@ interface proc_mgmt "Process management service" {
   rpc kill(in cap domain_cap, out errval err);
 
   // Let the process manager know the caller has finished execution.
-  //message exit(cap domain_cap, uint8 status);
-  rpc exit(in cap domain_cap, in uint8 status);
+  message exit(cap domain_cap, uint8 status);
+  //rpc exit(in cap domain_cap, in uint8 status);
 
   rpc wait(in cap domain_cap, out errval err, out uint8 status);
-
-  // TODO(razvan): exit, wait, status, some other calls from spawn.if?
 };
index 8ab4406..88af9d5 100644 (file)
@@ -501,7 +501,7 @@ errval_t proc_mgmt_exit(uint8_t status)
     struct proc_mgmt_binding *b = get_proc_mgmt_binding();
     assert(b != NULL);
 
-    err = b->rpc_tx_vtbl.exit(b, cap_domainid, status);
+    err = b->tx_vtbl.exit(b, NOP_CONT, cap_domainid, status);
     if (err_is_fail(err)) {
         return err;
     }
index ae1a673..b8c8c65 100644 (file)
@@ -61,7 +61,7 @@ static bool cleanup_request_sender(struct msg_queue_elem *m);
 
 
 #define PROC_MGMT_BENCH 1
-#define PROC_MGMT_BENCH_MIN_RUNS 100
+#define PROC_MGMT_BENCH_MIN_RUNS 150
 
 #ifdef PROC_MGMT_BENCH
 #include <bench/bench.h>
@@ -710,7 +710,8 @@ static struct proc_mgmt_rx_vtbl monitor_vtbl = {
     .spawn_with_caps_call = spawn_with_caps_handler,
     .span_call            = span_handler,
     .kill_call            = kill_handler,
-    .exit_call            = exit_handler,
+    // .exit_call            = exit_handler,
+    .exit                 = exit_handler,
     .wait_call            = wait_handler
 };
 
@@ -720,7 +721,8 @@ static struct proc_mgmt_rx_vtbl non_monitor_vtbl = {
     .spawn_with_caps_call = spawn_with_caps_handler,
     .span_call            = span_handler,
     .kill_call            = kill_handler,
-    .exit_call            = exit_handler,
+    // .exit_call            = exit_handler,
+    .exit                 = exit_handler,
     .wait_call            = wait_handler
 };