GNU bug report logs - #40023
26.3; Emacs crashes when creating process if many file handles are in use (e.g., when using ccls)

Previous Next

Package: emacs;

Reported by: Holger Pirk <holger <at> pirk.name>

Date: Wed, 11 Mar 2020 14:33:01 UTC

Severity: normal

Merged with 39164, 40555

Found in versions 27.0.60, 27.0.90, 26.3

Fixed in version 27.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 40023 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Holger Pirk <holger <at> pirk.name>
Cc: 40023 <at> debbugs.gnu.org
Subject: Re: bug#40023: 26.3; Emacs crashes when creating process if many
 file handles are in use (e.g., when using ccls)
Date: Wed, 11 Mar 2020 16:32:14 +0100
>>>>> On Wed, 11 Mar 2020 13:50:22 +0000, Holger Pirk <holger <at> pirk.name> said:

    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




This bug report was last modified 5 years and 94 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.