[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nmh-workers] closefds() _before_ fork?
From: |
Ken Hornstein |
Subject: |
[nmh-workers] closefds() _before_ fork? |
Date: |
Mon, 22 Apr 2019 15:52:48 -0400 |
I've been having a problem when occasionally at a What now? prompt when
I use the "send" command the process will get killed with a -9 out of
nowhere (this is on MacOS X High Sierra). I finally realized that the
same problem is causing the test suite to fail for the dist test, so I
decided to track it down.
The short answer is: it's because of closefds(). Specifically, the call
in the "sendit()" function in whatnowsbr.c, right before the call to
sendsbr(). What is happening is there is a specific descriptor marked as
something called the "NETPOLICY" descriptor, and if that is closed your
process is killed.
I understand why functions like closefds() are used right before exec(),
but in this case a fair amonut of stuff happens before exec is called,
and it's way before fork() is eventually called as well. The other uses
of closefds() are after a fork() occurs, or right before exec() happens
(see whom.c). Can anyone think of a reason that for this specific
case closefds() should NOT be moved from whatnowbr.c (and send.c) into
sendsbr.c, and just in the child process?
--Ken
- [nmh-workers] closefds() _before_ fork?,
Ken Hornstein <=
- Re: [nmh-workers] closefds() _before_ fork?, Ralph Corderoy, 2019/04/22
- Re: [nmh-workers] closefds() _before_ fork?, David Levine, 2019/04/22
- Re: [nmh-workers] closefds() _before_ fork?, Ken Hornstein, 2019/04/22
- Re: [nmh-workers] closefds() _before_ fork?, David Levine, 2019/04/22
- Re: [nmh-workers] closefds() _before_ fork?, Tom Lane, 2019/04/22
- Re: [nmh-workers] closefds() _before_ fork?, Ken Hornstein, 2019/04/22
- Re: [nmh-workers] closefds() _before_ fork?, Ralph Corderoy, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Valdis Klētnieks, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Ken Hornstein, 2019/04/23
- Re: [nmh-workers] closefds() _before_ fork?, Robert Elz, 2019/04/23