Protect handle issue-ettes

Christopher Faylor
Sun Jul 14 09:17:00 GMT 2002

On Sun, Jul 14, 2002 at 01:07:29PM +0100, Conrad Scott wrote:
>I've attached one patch to the protect handle mechanism: a
>forgotten "hl = hl->next" after find_handle() in setclexec().
>This cured a seg. fault I was getting in the cygwin_daemon branch
>when running make.

Thanks.  Applied.

>I'm still not clear why the cygserver code disturbs this mechanism
>so much: I wasn't getting the seg. fault on the HEAD version.
>I've now added calls to ProtectHandle into the cygserver code, so
>this doesn't seem to be anything to do with their (previous)
>Other than that, I'm still getting quite a bit of noise, all of
>which (that I've bothered to trace through) is due to handles that
>are non-inheritable (i.e. held in a NO_COPY variable and created
>with, e.g., sec_none_nih).  AFAICT, these need to be removed from
>the protected handle list on fork, not just on fork-exec.  I've
>attached a sample of the "noise" to the end of this message.
>Such handles include:
>    title_mutex
>    sigcatch_nonmain
>    sigcatch_main
>    sigcomplete_nonmain
>    sigcomplete_main

None of those are marked inheritable.

>I don't see any mechanism to do this in the code at present and
>I've not the time to go into this any further just now, but I hope
>that helps.

Huh?  The code in dll_crt0_1 is supposed to be called on a fork or an
exec.  That's why I renamed it to debug_fixup_after_fork_exec.
As far as I can tell it *is* called on a fork.  strace confirms


More information about the Cygwin-patches mailing list