Robert Pluim
2020-03-11 15:32:14 UTC
Holger> I have spent some time digging around the code and couldn't quite figure
Holger> out the logic behind the `fd < FD_SETSIZE`-assert. I suspect the CCLS
Holger> opens files without going through emacs' infrastructure which leads to
Holger> high file descriptors which emacs cannot handle. I would say that CCLS
Holger> is, in part, to blame but emacs shouldn't simply crash.
Emacs is limited by the limits of select, which supports a maximum of
FD_SETSIZE file descriptors, which on macOS is 1024
At least on macOS, itʼs possible to increase that value to eg 8192 by
setting FD_SETSIZE, which might alleviate this, but then you'd
probably run into the 'ulimit -n' maximum, so you'd have to remember
to increase that.
Using 'poll' would help, but as far as I know nobody is working on
converting emacs to use it.
It would be interesting to see how CCLS opens files. How does it pass
the descriptor back to emacs?
Robert
Holger> out the logic behind the `fd < FD_SETSIZE`-assert. I suspect the CCLS
Holger> opens files without going through emacs' infrastructure which leads to
Holger> high file descriptors which emacs cannot handle. I would say that CCLS
Holger> is, in part, to blame but emacs shouldn't simply crash.
Emacs is limited by the limits of select, which supports a maximum of
FD_SETSIZE file descriptors, which on macOS is 1024
At least on macOS, itʼs possible to increase that value to eg 8192 by
setting FD_SETSIZE, which might alleviate this, but then you'd
probably run into the 'ulimit -n' maximum, so you'd have to remember
to increase that.
Using 'poll' would help, but as far as I know nobody is working on
converting emacs to use it.
It would be interesting to see how CCLS opens files. How does it pass
the descriptor back to emacs?
Robert