On 16 November 2011 20:56, Mike Frysinger <[email protected]> wrote:
> On Wednesday 16 November 2011 14:38:17 Bernhard Reutner-Fischer wrote:
>> even with MMU (and only ignore HUP on !MMU to re-unify them).
>> +~98b
>
> i'm not sure about this.  you're introducing a race condition: if someone
> sends a signal and it happens to be delivered right after the clone(), then
> the child will have its signal handler called and utilize the stack.

You're right. So i'll play safe and retain the !MMU logic, makes sense.
>
> although i wonder why you're making this change.  glibc doesn't seem to ignore
> SIGHUP when forking.

Eli was pointing in that direction.
While i was about to wave-hands in that very same direction, the race
is indeed there for MMU so the fix sounds plausible.
Not that daemon() being racy is actually news, but well (no spec anyway).
>
>> -static inline attribute_optimize("O3")
>> -pid_t _fork_parent(void)
>> +static __always_inline
>> +pid_t fork_parent(void)
>>  {
>
> dropping of the -O3 is probably bad.  this is to try and make sure there is no
> stack usage even when people build with debug flags.  if the cloned child 
> tries
> to scribble on the stack, everything blows up.

always_inline should give enough opportunity for this not to happen,
but i admit that i didn't look.
Anyone curious enough to check with 4.6.2ff or trunk?

Thanks!
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to