all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: tromey@redhat.com
Cc: lekktu@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: the state of the concurrency branch
Date: Wed, 28 Aug 2013 18:58:20 +0300	[thread overview]
Message-ID: <8338ptg63n.fsf@gnu.org> (raw)
In-Reply-To: <83txicffpe.fsf@gnu.org>

> Date: Mon, 26 Aug 2013 21:51:41 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: tromey@redhat.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> I fixed the compilation, but the stuff in process.c needs work: if you
> invoke "M-x grep", Emacs aborts after Grep exits, here:
> 
>   void
>   delete_read_fd (int fd)
>   {
>     eassert (fd < MAXDESC);
>     eassert (fd <= max_desc); <<<<<<<<<<<<<<<<<
> 
> because max_desc is zero.

Here's some more info about this problem.  The assertion is violated
by the following series of calls:

  delete_read_fd (5);
  recompute_max_desc ();
  delete_read_fd (5);

The old code was doing FD_CLR instead of delete_read_fd, so it was
clearing twice the same bit, which doesn't hurt anything.  The new
code triggers the assertion, because clearing the flag bits in the
first delete_read_fd call causes recompute_max_desc to set max_desc to
zero, and the second call to delete_read_fd aborts.

If I remove the offending assertion, as in the patch below, the
problem goes away.

Why do we need these assertions?

=== modified file 'src/process.c'
--- src/process.c	2013-08-26 18:42:11 +0000
+++ src/process.c	2013-08-28 15:57:15 +0000
@@ -497,7 +497,6 @@ void
 delete_read_fd (int fd)
 {
   eassert (fd < MAXDESC);
-  eassert (fd <= max_desc);
   delete_keyboard_wait_descriptor (fd);
 
   if (fd_callback_info[fd].flags == 0)
@@ -559,7 +558,6 @@ delete_write_fd (int fd)
   int lim = max_desc;
 
   eassert (fd < MAXDESC);
-  eassert (fd <= max_desc);
 
 #ifdef NON_BLOCKING_CONNECT
   if ((fd_callback_info[fd].flags & NON_BLOCKING_CONNECT_FD) != 0)
@@ -6942,7 +6940,6 @@ delete_keyboard_wait_descriptor (int des
   int lim = max_desc;
 
   eassert (desc >= 0 && desc < MAXDESC);
-  eassert (desc <= max_desc);
 
   fd_callback_info[desc].flags &= ~(FOR_READ | KEYBOARD_FD | PROCESS_FD);
 




  parent reply	other threads:[~2013-08-28 15:58 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-25 19:26 the state of the concurrency branch Tom Tromey
2013-08-25 19:36 ` Paul Eggert
2013-08-25 19:43   ` Tom Tromey
2013-08-25 20:02     ` Paul Eggert
2013-08-26 14:55       ` Tom Tromey
2013-08-25 20:30     ` Tom Tromey
2013-08-26 16:48 ` Stefan Monnier
2013-08-26 17:04   ` Juanma Barranquero
2013-08-26 17:19     ` Tom Tromey
2013-08-26 18:51     ` Eli Zaretskii
2013-08-26 21:29       ` Stefan Monnier
2013-08-27  2:30         ` Tom Tromey
2013-08-27 16:08           ` Eli Zaretskii
2013-08-27 18:05             ` Paul Eggert
2013-08-27 18:23               ` Tom Tromey
2013-08-27 18:39                 ` Paul Eggert
2013-08-27 18:46                   ` Tom Tromey
2013-08-27 18:52                     ` Paul Eggert
2013-08-27 19:08                       ` Eli Zaretskii
2013-08-27 19:12                         ` Paul Eggert
2013-08-27 18:26               ` Eli Zaretskii
2013-08-27 19:14             ` Tom Tromey
2013-08-27 19:24               ` Eli Zaretskii
2013-08-27 19:29                 ` Tom Tromey
2013-08-28  0:50             ` Stefan Monnier
2013-08-28  4:16               ` Eli Zaretskii
2013-08-28  4:31                 ` Tom Tromey
2013-08-28  4:58                 ` Eli Zaretskii
2013-08-28 13:21                   ` Stefan Monnier
2013-08-28 13:48                     ` Tom Tromey
2013-08-28 14:27                       ` Stefan Monnier
2013-08-28 16:23             ` Eli Zaretskii
2013-08-29  3:54               ` Tom Tromey
2013-08-29 15:10                 ` Eli Zaretskii
2013-08-31  9:57                   ` Eli Zaretskii
2013-08-31 11:51                     ` Eli Zaretskii
2013-08-31 13:42                       ` Eli Zaretskii
2013-09-01 15:49                         ` Eli Zaretskii
2013-09-02 15:27                           ` Eli Zaretskii
2013-08-28  0:45           ` Stefan Monnier
2013-08-28  2:34             ` Tom Tromey
2013-08-27 18:33         ` Tom Tromey
2013-08-28 15:58       ` Eli Zaretskii [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-10-16 18:24 Barry OReilly
2013-10-16 20:25 ` Barry OReilly
2013-10-18  1:41   ` Tom Tromey
2013-10-18  3:32   ` Tom Tromey
2013-10-18 18:13     ` Stefan Monnier
2013-10-18 18:16       ` Tom Tromey
2013-10-19 18:41         ` Richard Stallman
2013-10-19 19:29         ` Barry OReilly
2013-10-19 21:42           ` Stefan Monnier
2013-10-20  0:41             ` Barry OReilly
2013-10-21 15:08             ` Tom Tromey
2013-10-21 16:07               ` Barry OReilly
2013-10-21 18:17                 ` Stefan Monnier
2013-10-21 16:41               ` Stefan Monnier
2013-10-19 20:21         ` Barry OReilly

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

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

  git send-email \
    --in-reply-to=8338ptg63n.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=tromey@redhat.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.