On Tue, Apr 19, 2011 at 1:22 AM, Jan Stancek <[email protected]> wrote:
>
> This test failed sporadically, because of:
>
> 1. misusage of getpwnam causes ltpuser1 and ltpuser2 to point
> to same passwd structure, from getpwnam(3):
> "The return value may point to a static area, and may be overwritten by
> subsequent calls to getpwent(3)."
> Fix this by copying the results from returned pointer.
>
> 2. race condition between parent and child
> The test actually worked when child didn't have time to set its euid.
> Fix this by waiting for child to set its euid.
>
> Signed-off-by: Jan Stancek <[email protected]>
> ---
>  testcases/kernel/syscalls/kill/kill05.c |   47 ++++++++++++++++++++++--------
>  1 files changed, 34 insertions(+), 13 deletions(-)

    I'm puzzled by the first wait_for_flag invocation. Wouldn't that
continue to loop in the infinite loop with the parent pid?
Furthermore, it doesn't make sense for wait_for_flag to be used at all
(or the equivalent in the existing test) in the test as the memory
isn't shared between processes after the fork is done, apart from
dealing with vfork -- which is only with UCLINUX (fork does COW, vfork
doesn't), and the subsequent exec does the COW for us.
    This really should use pipes or something equivalent to message
the child process(es) to continue.
Thanks,
-Garrett

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to