From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <865E1017-DFA9-495D-BCDA-70B46FE09A27@pirk.name> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="43460"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40023@debbugs.gnu.org To: Holger Pirk Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 11 16:34:41 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jC3NZ-000B8r-Nu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Mar 2020 16:34:41 +0100 Original-Received: from localhost ([::1]:54312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jC3NY-0006sb-Mk for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Mar 2020 11:34:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58224) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jC3Lz-0001oG-PU for bug-gnu-emacs@gnu.org; Wed, 11 Mar 2020 11:33:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jC3Ly-0007Ik-M0 for bug-gnu-emacs@gnu.org; Wed, 11 Mar 2020 11:33:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49392) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jC3Ly-0007IT-GK for bug-gnu-emacs@gnu.org; Wed, 11 Mar 2020 11:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jC3Ly-0002AB-5n for bug-gnu-emacs@gnu.org; Wed, 11 Mar 2020 11:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Mar 2020 15:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40023 X-GNU-PR-Package: emacs Original-Received: via spool by 40023-submit@debbugs.gnu.org id=B40023.15839407448204 (code B ref 40023); Wed, 11 Mar 2020 15:33:02 +0000 Original-Received: (at 40023) by debbugs.gnu.org; 11 Mar 2020 15:32:24 +0000 Original-Received: from localhost ([127.0.0.1]:55365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jC3LM-00028F-87 for submit@debbugs.gnu.org; Wed, 11 Mar 2020 11:32:24 -0400 Original-Received: from mail-wr1-f48.google.com ([209.85.221.48]:32946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jC3LL-00027m-5W for 40023@debbugs.gnu.org; Wed, 11 Mar 2020 11:32:23 -0400 Original-Received: by mail-wr1-f48.google.com with SMTP id a25so3225761wrd.0 for <40023@debbugs.gnu.org>; Wed, 11 Mar 2020 08:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=dbM5Vxr1lzpwPIxa5YOMZ9MlNDu/uzwVyP6s0JDulvU=; b=sp0X5QFGySooa6fcO1749qMW1AgYPwZA0EEJ+ByiR/d1CqD6saGKe4IWGOSfTT9I7F uqF2U11N9LKAjx73juF6QYmsD7bAip2nIlnHsxC/wldfLxJqzdE4XC2X2U3xN5GuoTwM rAO5jNxAUrS6aPZ01lee63wvcn3Aj916xhuGwO4elWlSTVGbHd9up4JOprWfVEzjU6sr EDJH28+hZ3caeg2Dw+78dW9ZLY1bWWvajnxkGmWLwhz2KS9MBXVDqQqSBsVuYKv0z8gd X0U72cD0egr/nL4v6+9uoEwnIEXdvs95arINFXAYPCEKmGIY5lW9pG1m4eOImJq1SvLl WAOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=dbM5Vxr1lzpwPIxa5YOMZ9MlNDu/uzwVyP6s0JDulvU=; b=RotyruYdfUzPSuzIuHwoaNF/xty4Rz3FzN99AYwhPYYI1OAFDDvelSiNah9FA7lnUm 4PgEbiINWcOlTvt/vFUAa5mWIRRK7GissQ5HVpNTIEXYiW83O/isvYj5pXuTNhw3mLrx N4WSbAsPixOpnCU16HCeGyFiP+6aPFXOoNgE2qsjFnxCSc2Z5D+kQC6jfXAbt9oeThvr pyp9L9Dl1AlRccCQvqqiVTpPVG8grlovdk1tdd5bra8IA6AWbYSUP38d2KmDYfvmcYc5 ePAvInYWi7upTHwlCmVmAZe0ren+aPdhXFd02TB73rOeb9btrG+Bvat2C8duTQkj/VYH 0Fkg== X-Gm-Message-State: ANhLgQ1eMLT9sATflC4BOtAKBilJ1fIPvColYDbsm70k5Iz4A+7i5T8x DjluAZ7tD3SmT+jOPjc7YNJAmiJi X-Google-Smtp-Source: ADFU+vv+B4ncQydUmNzZ7UzkCQb1pKmMnwB7BrSigJWCugFZ/Mox3oe0VQQf+1MY6W+mLmY4yeptiQ== X-Received: by 2002:adf:ee52:: with SMTP id w18mr4935095wro.369.1583940736862; Wed, 11 Mar 2020 08:32:16 -0700 (PDT) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id 12sm8753879wmo.30.2020.03.11.08.32.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 08:32:16 -0700 (PDT) In-Reply-To: <865E1017-DFA9-495D-BCDA-70B46FE09A27@pirk.name> (Holger Pirk's message of "Wed, 11 Mar 2020 13:50:22 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177181 Archived-At: >>>>> On Wed, 11 Mar 2020 13:50:22 +0000, Holger Pirk sa= id: Holger> I have spent some time digging around the code and couldn't qui= te figure Holger> out the logic behind the `fd < FD_SETSIZE`-assert. I suspect th= e CCLS Holger> opens files without going through emacs' infrastructure which l= eads to Holger> high file descriptors which emacs cannot handle. I would say th= at 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=CA=BCs 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