On Sat, Jun 14, 2014 at 10:25 PM, Ian Wadham <[email protected]> wrote:
> The procedure for closing the file descriptors is a bit brute force. It
> uses
> "struct rlimit rlp; getrlimit(RLIMIT_NOFILE, &rlp);" to find out how many
> open files the user is allowed (my system says 2560) and then does
> "close();" on ALL of them except 0, 1and 2 (stdin, etc.).
>
> I thought that might be causing the second signal - there are only about
> 10 descriptors open - but it still happens even when I insert a test for a
> valid file descriptor ("if (fcntl(i, F_GETFL) != -1)") and end the loo when
> I get to an invalid one. I know - not perfect … ;-)
>
Where exactly is it receiving the signal?
Beware of thread stacks, which may be in the heap; if the per-thread stack
size is too small, you will definitely see things like this and stack
allocation/extension in the SEGV handler (like, that struct rlimit) will
make it worse unless you use sigaltstack.
--
brandon s allbery kf8nh sine nomine associates
[email protected] [email protected]
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev