difficulties with Loader

Alexander Valitov valitov79 at mail.ru
Mon Mar 23 15:14:19 CET 2009


During my play with 'run' application (./l4/pkg/loader/examples/run) I've
discovered two issues. They both applies to the chain

1. First issue:

I start 'con_demo1' application using 'run' utility 'l' command, then try to
kill it. Kill process fails with following output (here F.02 is 'run'
thread, 10.00 is 'con_demo1' task):

  A.00:simplets| task_kill(): Kill 10.00 from E.02 but owner is F.02
  E.02:loader  | l4ts_kill_task(): failed (dest=10.00 server=A.00, ret=-11,
exc 0)
  E.02:loader  | con_demo1,#10: Error -11 (not owner) killing task (ignored)

It looks like inconsistency in loader's behavior.
'run' uses l4loader_app_open_call() and l4loader_app_kill_call() l4loader's
methods to start and kill application, but l4loader_app_kill_call()
invocation always fails as 'loader' explicitly set 'run' as owner:

  /* set client as owner so that client is able to kill that task */
  if ((error = l4ts_owner(app->tid, app->owner)))
      app_msg(app, "Error %d (%s) setting ownership", error,
      return error;

But 'l4loader' implicitly passes itself as caller when he makes call to
l4ts_kill_task() in app_cleanup_extern() function. So I think inconsistency
is quite obvious. A straightforward solution here is just to remove
l4ts_owner() invocation from l4loader's code.

Do I miss something?

2. Second issue

Scenario is the same as before:  'con_demo1' is started by 'run' and then
killed by using run's 'kill' command.

In this case:
- 'run' calls l4loader_app_kill_call()
- 'l4loader' calles app_cleanup_extern()
- app_cleanup_extern() calles l4ts_kill_task(app->tid, 0)

As a result simple_ts will not free allocated TaskNo for 'con_demo1' (use
run's 'A' command for TS state after task has been killed).
I think last argument for l4ts_kill_task() function is wrong. It should look
like that:

l4ts_kill_task(app->tid, L4TS_KILL_FREE)

here is a path for the last issue:

Index: app.c
--- app.c       (revision 439)
+++ app.c       (working copy)
@@ -1488,7 +1488,7 @@
   if (!l4_is_invalid_id(app->tid))
       killing = app->tid;
-      if ((error = l4ts_kill_task(app->tid, 0)))
+      if ((error = l4ts_kill_task(app->tid, L4TS_KILL_FREE)))
         app_msg(app, "Error %d (%s) killing task (ignored)",
                    error, l4env_errstr(error));

Any objections?

Best regards,
 Alexander Valitov
View this message in context: http://www.nabble.com/difficulties-with-Loader-tp22660946p22660946.html
Sent from the L4 mailing list archive at Nabble.com.

More information about the l4-hackers mailing list