difficulties with Loader

Alexander Boettcher boettcher at os.inf.tu-dresden.de
Mon Mar 23 17:41:58 CET 2009


Hi,

Alexander Valitov wrote:
> Hi,
> 
> During my play with 'run' application (./l4/pkg/loader/examples/run) I've
> discovered two issues. They both applies to the chain
> 'run'<->'loader'<->'simple_ts'.
> 
please find attached a patch, which should fix your problems you
discovered. Your patches by skipping transferring ownership will break
L4Linux when using simple_ts. The issues you discovered are due to some
incompatibilities of simple_ts and tasklib. The 'run' application wasn't
adapted carefully (by me) to run with both, tasklib and simple_ts. The
changes will be in public svn in the next days.

Thanks for pointing to the issue.

Alex B.

> 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,
> l4env_errstr(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));
>        else
> 
> Any objections?
> 
> Best regards,
>  Alexander Valitov


-- 
boettcher at os.inf.tu-dresden.de
key finger print: 5E79 31F6 F571 5FBA CF75  33FB AA34 4AF4 A633 25B3
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: run.diff
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20090323/1bd43623/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20090323/1bd43623/attachment.asc>


More information about the l4-hackers mailing list