Switching off size-optimization (remove -Os compiler option) helps
my test-app, all addresses are now the same in parent and child process.
Carsten
De:
owner-microblaze-uclinux@xxxxxxxxxxxxxx
[mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] En nombre de sgomes@xxxxxxxxxxx
Enviado el: martes, 03 de marzo de 2009 15:06
Para: microblaze-uclinux@xxxxxxxxxxxxxx
Asunto: [microblaze-uclinux] PPPD problem with fork()
Hi,
I currently use
the petalinux system with MMU support. I use the sources files retrieved from
petalinux-mmu-v0.10.tar.gz and not the latest sources files.
When I try to
use pppd application to communicate with a modem, I have a bug.
I use pppd with
the connect option which gives pppd a command to execute. This command
is executed using a fork() and execv().
The problem is
that after the fork() call, in the created child, the pointers, pointing on
strings in the parent, point on a NULL pointer.
But if I
compile pppd with #define __uCLinux__ which implies to use a
vfork() instead a fork(), pppd runs properly.
Has someone met
the same problem in pppd or in other applications using a fork()?
Regards,
Stephane