[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] PPPD problem with fork()



Hi Carsten,

I have done the test on S3a1800DSP reference platform with the current PetaLinux SVN trunk.
I believe the issue's been fixed. Please update your PetaLinux and do the test again.

Here is my test result:

1) With -Os option:

Compilation command:
mb-linux-gcc  -c -Os -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall  -mno-xl-soft-mul -mcpu=v7.10.c   -DEMBED -I/home/wendy/petalogix/internal/trunk/software/petalinux-dist -I/home/wendy/petalogix/internal/trunk/software/petalinux-dist/include -I/home/wendy/petalogix/internal/trunk/software/petalinux-dist/include -Dlinux -D__linux__ -Dunix -DLINUX -o process-test.o process-test.c
mb-linux-gcc   -L/home/wendy/petalogix/internal/trunk/software/petalinux-dist/lib -o process-test process-test.o

Test result:
# ./process-test
the main program process ID is 44
before forking: textptr=bff17da0 &textptr=bff17d98 *textptr=I am a stupid text.
before forking: numpointer=bff17d94 &numptr=bff17d9c *numptr=9876
before forking: number=9876 &number=bff17d94

this is the parent process, with id 44  the child's process ID is 45
parent        : textptr=bff17da0 &textptr=bff17d98 *textptr=I am a stupid text.
parent        : numptr=bff17d94 &numptr=bff17d9c *numptr=9876
parent        : number=9876 &number=bff17d94

this is the child process, with id 45
child         : textptr=bff17da0 &textptr=bff17d98 *textptr=I am a stupid text.
child         : numptr=bff17d94 &numptr=bff17d9c *numptr=9876
child         : number=9876 &number=bff17d94

2) Without -Os option:
Compilation command:
mb-linux-gcc  -c -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall  -mno-xl-soft-mul -mcpu=v7.10.c   -DEMBED -I/home/wendy/petalogix/internal/trunk/software/petalinux-dist -I/home/wendy/petalogix/internal/trunk/software/petalinux-dist/include -I/home/wendy/petalogix/internal/trunk/software/petalinux-dist/include -Dlinux -D__linux__ -Dunix -DLINUX -o process-test.o process-test.c
mb-linux-gcc   -L/home/wendy/petalogix/internal/trunk/software/petalinux-dist/lib -o process-test process-test.o

Test result:
# ./process-test
the main program process ID is 46
before forking: textptr=bf966da4 &textptr=bf966dbc *textptr=I am a stupid text.
before forking: numpointer=bf966db8 &numptr=bf966dc0 *numptr=9876
before forking: number=9876 &number=bf966db8

this is the parent process, with id 46  the child's process ID is 47
parent        : textptr=bf966da4 &textptr=bf966dbc *textptr=I am a stupid text.
parent        : numptr=bf966db8 &numptr=bf966dc0 *numptr=9876
parent        : number=9876 &number=bf966db8

this is the child process, with id 47
child         : textptr=bf966da4 &textptr=bf966dbc *textptr=I am a stupid text.
child         : numptr=bf966db8 &numptr=bf966dc0 *numptr=9876
child         : number=9876 &number=bf966db8

Regards,
Wendy

On Fri, Mar 13, 2009 at 9:58 AM, John Williams <john.williams@xxxxxxxxxxxxx> wrote:
Hi Wendy,

Can you please test the attached program on an petalinux MMU system
build from current SVN trunk?  Any HW project is OK, s3aDSP or
whatever is easiest for you.

Carsten finds some error in fork() and pointer handling, with
different CPU optimisations.  He is using original MMU test release,
not SVN head, so maybe it is already fixed.

Thanks,

John


---------- Forwarded message ----------
From: Bartsch Carsten <cbartsch@xxxxxxxxxx>
Date: Fri, Mar 13, 2009 at 1:29 AM
Subject: RE: [microblaze-uclinux] PPPD problem with fork()
To: microblaze-uclinux@xxxxxxxxxxxxxx


Attached you will find the test.
Make it with the default Makefile generated by petalinux-new-app.
Btw: I'm using a petalinux-mmu-v0.10 on a Sp3A-DSP-1800A-Starter.
It was only tested on my platform, not on a reference platform.

This following text is the output after a normal make:

# /ua/process-test/process-test
the main program process ID is 104
before forking: textptr=bf907e00 &textptr=bf907df8 *textptr=I am a
stupid text.
before forking: numpointer=bf907df4 &numptr=bf907dfc *numptr=9876
before forking: number=9876 &number=bf907df4

this is the parent process, with id 104  the child's process ID is 105
parent        : textptr=bf907e00 &textptr=bf907df8 *textptr=I am a
stupid text.
parent        : numptr=bf907df4 &numptr=bf907dfc *numptr=9876
parent        : number=9876 &number=bf907df4

this is the child process, with id 105
child         : textptr=bf907e00 &textptr=2 *textptr=I am a stupid text.
child         : numptr=bf907df4 &numptr=0 *numptr=9876
child         : number=9876 &number=0


The following text is the output after removing the -Os option:

# /ua/process-test/process-test
the main program process ID is 106
before forking: textptr=bfa67e04 &textptr=bfa67e1c *textptr=I am a
stupid text.
before forking: zahlpointer=bfa67e18 &numptr=bfa67e20 *numptr=9876
before forking: number=9876 &number=bfa67e18

this is the parent process, with id 106  the child's process ID is 107
parent        : textptr=bfa67e04 &textptr=bfa67e1c *textptr=I am a
stupid text.
parent        : numptr=bfa67e18 &numptr=bfa67e20 *numptr=9876
parent        : number=9876 &number=bfa67e18

this is the child process, with id 107
child         : textptr=bfa67e04 &textptr=bfa67e1c *textptr=I am a
stupid text.
child         : numptr=bfa67e18 &numptr=bfa67e20 *numptr=9876
child         : number=9876 &number=bfa67e18


The difference is the addresses. In the child process the content is
there but the addresses are lost.



-----Mensaje original-----
De: owner-microblaze-uclinux@xxxxxxxxxxxxxx
[mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] En nombre de John
Williams
Enviado el: jueves, 12 de marzo de 2009 12:06
Para: microblaze-uclinux@xxxxxxxxxxxxxx
Asunto: Re: [microblaze-uclinux] PPPD problem with fork()

Hi Carsten,

On Wed, Mar 4, 2009 at 1:07 AM, Bartsch Carsten <cbartsch@xxxxxxxxxx>
wrote:
> with a small test-application I see the same problem (using MMU and
fork()).
>
> My first impression is that this happens if you want to share only a
> pointer. You could try sharing other "padding"- variables (use them in
the
> child). Some addresses look strange in the childs process. I didn't
dig
> deeper yet.

Can you please post this test app?  The smaller the better :)

Thanks,

John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive :
http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/




--
John Williams, PhD, B.Eng, B.IT
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com  p: +61-7-30090663  f: +61-7-30090663