unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Holger Pirk <holger@pirk.name>
Cc: 40023@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <m2v9navrep.fsf@gmail.com> (raw)
In-Reply-To: <865E1017-DFA9-495D-BCDA-70B46FE09A27@pirk.name> (Holger Pirk's message of "Wed, 11 Mar 2020 13:50:22 +0000")

>>>>> On Wed, 11 Mar 2020 13:50:22 +0000, Holger Pirk <holger@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





  reply	other threads:[~2020-03-11 15:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 13:50 bug#40023: 26.3; Emacs crashes when creating process if many file handles are in use (e.g., when using ccls) Holger Pirk
2020-03-11 15:32 ` Robert Pluim [this message]
2020-03-11 16:17   ` Eli Zaretskii
2020-03-11 16:45     ` Holger Pirk
2020-03-12  7:27       ` Robert Pluim
2020-03-12  7:26     ` Robert Pluim
2020-03-12 15:11       ` Eli Zaretskii
2020-03-12 15:24         ` Robert Pluim
2020-03-12 15:50           ` Eli Zaretskii
2020-03-12 16:46             ` Robert Pluim
2020-03-19 10:41               ` Robert Pluim
2020-03-19 14:36                 ` Eli Zaretskii
2020-04-11 18:15 ` bug#40023: 26.3 " Mattias Engdegård
2020-04-11 19:02   ` Eli Zaretskii
2020-04-12 10:19   ` Michael Albinus
2020-04-14 13:58     ` Robert Pluim
2020-04-14 16:02       ` Mattias Engdegård
2020-04-14 16:14         ` Robert Pluim
2020-04-14 16:23           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2v9navrep.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=40023@debbugs.gnu.org \
    --cc=holger@pirk.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).