zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Cc: "lilydjwg@gmail.com" <lilydjwg@gmail.com>
Subject: It seems that I find a zle -F full CPU bug
Date: Thu, 20 Feb 2014 11:36:26 -0800	[thread overview]
Message-ID: <CAH+w=7ZQ3ivj3DOe0e4z7_w=Av-FvLxfxzdb3vtWQpzvhCmoLw@mail.gmail.com> (raw)
In-Reply-To: <20140220131659.GA21182@lilyforest>

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

[ > workers ]

On Thursday, February 20, 2014, lilydjwg <lilydjwg@gmail.com> wrote:

> On Thu, Feb 20, 2014 at 09:40:53AM +0000, Peter Stephenson wrote:
> > On Wed, 19 Feb 2014 23:30:52 -0800
> > Bart Schaefer <schaefer@brasslantern.com> wrote:
> > >  I suppose we could drop the fd on the first POLLNVAL for the duration
> of
> > > that particular loop, but then reinstate it before restarting the loop
> > > after the next user input.
> >
> > That doesn't sound a bad compromise.
>
> I think this will work. Or we can just break the loop if all we get from
> the poll result is POLLNVAL so that handlers can remove bad fds.


Hmm ... looking at the loop, there is already some provision for this.  If
poll() [or select()] returns -1, we discard all the handler FDs etc. and
repeat with just the SHTTY FD.  I wonder if the situation that code is
meant to handle is even possible.

If we're really trying to avoid pathologically bad behavior, we can't rely
on the handler to remove the descriptor.

This is going to require more #ifdef's to examine fds[] in the poll() case
and the bits in errfds in the select() case.

Aside:  Am I misreading the code, or is it the case that the (HAVE_TIO &&
sun) #ifdef branch does not support zle -F ?


> The handler can know that the fd is closed in case of 'poll': the
> handler will get an argument like 'hup' or 'nval'.


I don't think the handler ever gets anything but a file descriptor number?

       reply	other threads:[~2014-02-20 19:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140220050415.GA29027@lilyforest>
     [not found] ` <CAH+w=7Z+R_ZexSkesp2z+ndooHStOGJcMeWXtD7HCunjqJp9-Q@mail.gmail.com>
     [not found]   ` <20140220094053.137da74f@pwslap01u.europe.root.pri>
     [not found]     ` <20140220131659.GA21182@lilyforest>
2014-02-20 19:36       ` Bart Schaefer [this message]
2014-02-20 20:04         ` Peter Stephenson
2014-02-20 20:47         ` Bart Schaefer
2014-02-21 16:27           ` lilydjwg
2014-02-23 23:07           ` Bart Schaefer
2014-02-24 13:53             ` lilydjwg

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='CAH+w=7ZQ3ivj3DOe0e4z7_w=Av-FvLxfxzdb3vtWQpzvhCmoLw@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=lilydjwg@gmail.com \
    --cc=zsh-workers@zsh.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.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).