Fixing KDE debug dialog and Dr Konqui to run on OS X

Brandon Allbery allbery.b at gmail.com
Sat Jun 14 20:03:28 PDT 2014


On Sat, Jun 14, 2014 at 10:25 PM, Ian Wadham <iandw.au at gmail.com> 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
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20140614/bf30e890/attachment.html>


More information about the macports-dev mailing list