Fixing KDE debug dialog and Dr Konqui to run on OS X
Clemens Lang
cal at macports.org
Sun Jun 15 01:28:34 PDT 2014
Hi,
> > 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 have now re-tested with a crash in another app, which can be induced
> by doing stuff on the app's screen. It gave SIGSEGV (=11), but the second
> signal was still SIGILL (=4), i.e. it is a new signal, not a repeat of the
> first one (as I originally thought). So there must be a second crash
> somewhere in the code that closes the files or handles 2500+ invalid file
> descriptors.
I guess you're seeing what can be found by googling for
BUG in libdispatch client: Do not close random Unix descriptors.
Long story short, you'll probably have to stop closing all file descriptors,
because OS X's libdispatch library has a few file descriptors of its own and
reacts with this signal if you close those. There doesn't seem to be a way
to avoid libdispatch (disabling native language support apparently works for
some people, but I'm sure that's not an option here) and no way to find out
which file descriptors are used by libdispatch, so all you can do is only
close descriptors where you know that they have been opened by KDE code.
--
Clemens Lang
More information about the macports-dev
mailing list