GNU bug report logs - #24325
25.1; Crash - fd larger than FD_SETSIZE

Previous Next

Package: emacs;

Reported by: Robin Campbell Joy <emacs <at> robinjoy.net>

Date: Sun, 28 Aug 2016 17:12:02 UTC

Severity: normal

Found in version 25.1

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Robin Campbell Joy <emacs <at> robinjoy.net>
To: 24325 <at> debbugs.gnu.org
Subject: bug#24325: 25.1; Crash - fd larger than FD_SETSIZE
Date: Sun, 28 Aug 2016 22:44:21 +0200
[Message part 1 (text/plain, inline)]
> On 28 August 2016 at 19:53, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: Robin Campbell Joy <emacs <at> robinjoy.net>
> > Date: Sun, 28 Aug 2016 11:25:39 +0200
> >
> > After a short time emacs is crashing while trying to communicate with an
> > external process.
> >
> > In the debugger I can see that the fd is larger than FD_SETSIZE. The fd
> > is used in process.c:7168-7177 (setup_process_coding_system) to index
> > into proc_decode_coding_system which is of size FD_SETSIZE and is
> > crashing at process.c:5708 when dereferencing coding->id.
>
> Do you really have several hundreds of subprocesses and/or network
> connections active in that session?  If not, how come all the
> descriptors below 1024 are in use?

This seems to be a bug in rtags.el or my configuration or a combination of
both.
 It is calling start-file-process several hundred times. Not sure yet why.

>
> I also don't understand how this:
>
> > #0 0x00000000004942a4 in setup_coding_system (coding_system=4602512,
coding=0xffffffffffffffff) at
> > coding.c:5706
> > eol_type = <optimized out>
>           ^^^^^^^^^^^^
> Can happen in a build that claims to use 'CFLAGS=-ggdb3 -O0'.  Did you
> report the bug from the same binary that crashes?
>
> I guess we will have to refuse to handle a process if its infd and
> outfd are at or above FD_SETSIZE, like we do on MS-Windows?

sorry, I also tried to reproduce it with a non-optimized build to see if I
can see more in the debugger, however I just ran into memory corruption
which lead to all kinds of erratic behaviour but not to a crash. I used the
non-optimized one to generate the bug report as the optimized one is
crashing shortly after startup. I thought I removed the additional CFLAGS
but seems like I missed at least one. The rest of the build flags should be
correct, just without 'CFLAGS=-ggdb3 -O0'
[Message part 2 (text/html, inline)]

This bug report was last modified 8 years and 308 days ago.

Previous Next


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