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
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 #40 received at control <at> debbugs.gnu.org (full text, mbox):
merge 40555 40023
thanks
> From: Matthieu Hauglustaine <matt.hauglustaine <at> gmail.com>
> Date: Sat, 11 Apr 2020 17:24:16 +0200
>
> I've experienced a EXC_BAD_ACCESS when using Emacs 27.0.90 on OS X
> 10.15.
>
> The root cause appears to be an out of bound access on
> proc_decode_coding_system (src/process.c:7988), in
> setup_process_coding_systems() when calling setup_coding_system(). This
> results in an invalid write to coding->id from
> CHECK_CODING_SYSTEM_GET_ID (src/coding.c:5678). [1] for the stacktrace.
>
> On Emacs initialization (init_process_emacs(), src/emacs.c:8234),
> RLIMIT_NOFILE.rlim_cur is set to FD_SETSIZE, and the assumption seem to
> be that this limit will never change for the lifetime of the
> process. proc_decode_coding_system and proc_encode_coding_system are
> declared with a size of FD_SETSIZE (src/process.c:311).
>
> However, on OS X systems, the call to NSURL.getResourceValue:forKey:
> (src/nsfns.c:497), when opening a file, apparently result in a call to
> setrlimit with RLIMIT_NOFILE.rlim_cur > FD_SETSIZE.
>
> Thus, when the number of FDs opened by Emacs is greater than FD_SETSIZE,
> an illegal access is done when make-process is called.
Thankjs, this is bug#40023. There's a patch there, maybe you could
try it. If the patch works for you, we could install it on the
emacs-27 branch.
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.