unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robin Campbell Joy <emacs@robinjoy.net>
To: 24325@debbugs.gnu.org
Subject: bug#24325: 25.1; Crash - fd larger than FD_SETSIZE
Date: Sun, 28 Aug 2016 22:44:21 +0200	[thread overview]
Message-ID: <CADzxVkGBP7Fag9jgZUJSTb+YgegdgxMyqJ30-TcZ4BgaE-e1Wg@mail.gmail.com> (raw)
In-Reply-To: <83wpj0bx0r.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]

> On 28 August 2016 at 19:53, Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Robin Campbell Joy <emacs@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'

[-- Attachment #2: Type: text/html, Size: 2288 bytes --]

  reply	other threads:[~2016-08-28 20:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-28  9:25 bug#24325: 25.1; Crash - fd larger than FD_SETSIZE Robin Campbell Joy
2016-08-28 17:53 ` Eli Zaretskii
2016-08-28 20:44   ` Robin Campbell Joy [this message]
2016-09-02  4:23 ` Paul Eggert
2016-09-12 18:44   ` Robin Campbell Joy
2016-09-12 19:27     ` Paul Eggert

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=CADzxVkGBP7Fag9jgZUJSTb+YgegdgxMyqJ30-TcZ4BgaE-e1Wg@mail.gmail.com \
    --to=emacs@robinjoy.net \
    --cc=24325@debbugs.gnu.org \
    /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).