[uCsimm] RE: [UCLINUX] BIIIIG conceptual problem with ucLinux

From: fabien.klein@conexant.com
Date: Fri Feb 04 2000 - 05:58:42 EST

Hello Vadim

First I thought my system crash after calling vfork -execxx was due to the
you highligthted yesterday but in fact it was due to another problem which
occurs before the execve system call
Here is what happened

when I link my code with libc, the call to execlp generate this assembly:


r5 is set with argv = shortargv
at the begining of the loop r1 = r5 !!!!!!!!!!!!!!!!!!!!!!!! ==> dead loop

mov r4,#1
ldr r3,[r1],#4 @ it's va_arg (args,const char *) <---------
mov r2,r4 |
str r3,[r5,r4,lsl #2] |
add r4,r4,#1 |
ldr r3,[r5,r2,lsl #2] |
cmp r3,#0 |
bne ------- infinite loop if

in execlp.c it's
int execlp(file,arg)
     argv[i] = va_args(args,const char*)
} while (argv[i++];

and this fill the memory with garbage untill the system crashes with a data
abort error


"Vadim Lebedev" <vlebedev@aplio.fr> on 02/03/2000 07:50:22 PM

To: Fabien Klein/Intl/Conexant@CNXT
cc: "uCLinux" <uclinux@c3po.kc-inc.net>, ucsimm@uClinux.org
Subject: RE: [UCLINUX] BIIIIG conceptual problem with ucLinux

Hi Fabien,

This problem will show up on all version of ucLinux....

However, thinking about it little bit more, it seems that the problem
is not so critical...

when a task A does 'vfork' under ucLinux, it remains blocked until
the child does 'exec'... So even if the achild access the parent's address
space this access is really not simultaneous with the parrent.
If the access is only limited to errno variable it is acctually no big deal
all, because the vfork will return success to the parent the parent will
ignore the error code stored in the errno....

Of course the child task code should be really simple after vfork,
     exec, and _exit in case of failure

Still the idea to reserve C-Runtime specific area in the ucLinux task
seems attractive to me.


-----Original Message-----
From: fabien.klein@conexant.com [mailto:fabien.klein@conexant.com]
Sent: jeudi 3 f

Úvrier 2000 19:17
To: Vadim Lebedev
Subject: Re: [UCLINUX] BIIIIG conceptual problem with ucLinux

Salut Vadim

Est ce que c'est un probleme specifique a arm-uclinux ?
Ca voudrait dire que toutes les applications users (shells and co) seraient
inutilisables a l heure actuelle ?
J etais justement stuck avec ce probleme en essayant de lancer init qui fait
nombreuses combinaisons vfork -execxx...

As tu deja experimente les eventuels work-around (combinaison vfork-execv ou
2eme methode ??)


This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/

This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:34 EST