genodelabs/genode — pull request #450 by myrkr (2012-10-29 10:31:05+00:00)
Title: lx_hybrid: Set SIGIGN for SIGCHLD only for newly created processes

The call of sigaction within adopt_thread (which was created to fix
issue #271) causes issues in the following call trace:

adopt_thread (meta_data=0x7fc4b0004f20) at .../base-linux/src/platform/lx_hybrid.cc:163
0x000000000049abe3 in Genode::Thread_base::myself () at .../base-linux/src/platform/lx_hybrid.cc:2500x00000000004998b4 in Genode::Ipc_client::Ipc_client (this=0x7fc4b6268e90, srv=..., snd_msg=0x7fc4b6268f00, rcv_msg=) at .../base-linux/src/base/ipc/ipc.cc:138
0x000000000049ba29 in Genode::Capability::_call (this=, args=..., ret=) at .../base/include/base/rpc_client.h:113
0x000000000049bba5 in call (v2=1, v1=..., this=) at .../base/include/base/capability.h:230
Genode::Signal_session_client::submit (this=, receiver=..., cnt=4835049) at .../base/include/signal_session/client.h:39
...

The signal is sent from a native linux process which has its own
signal handling. After this call sigchld for forked processes are
no longer notified in that process.

This commit moves the sigaction call to lx_create_process so that
only processes created within the Genode environment gets the signal
ignored.

This commit also avoided the zombie states in my tests with chroot
loader that what the reason for issue #271.