Zsh Mailing List Archive
Messages sorted by:
Re: It seems that I find a zle -F full CPU bug
- X-seq: zsh-users 18499
- From: lilydjwg <lilydjwg@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: It seems that I find a zle -F full CPU bug
- Date: Thu, 20 Feb 2014 21:16:59 +0800
- Disposition-notification-to: missyou11@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to :disposition-notification-to:user-agent; bh=AIGqx+Z0iQ5QP+8IZkT6r3cztxajLn0FoLgjM2dJiqM=; b=dWxqOSobJtSN7zyg2ACQzb7FAAosLM10RzvVeXG4t2fCgIUGGDukItXWoC3JGwYb15 N+ol0ZVfIHsYymFovZvFQhttay9fUnYjdba28TwChgJC4RRpSbZ67HqMTjjQRaejhDsn /6bNB720IJJthXcSmNoePbg9pfsSgFVc/FUs+1GE4gxgJHdi5WTaDmMQckqOLvHX3JA9 qjy4Qn6evH2JHJC8E5HgewxiYgKZ/ROLaBX/Cb+7WW7Y54GqsVf8+Z0yeSlB7MIJ4kSP IuFE3S0NJweE+2m3v6hkuH2CsGgE91Ki3u+8hPqbUu33Dl8/bTnHMj6iqG1T+vMozvYL EoiA==
- In-reply-to: <email@example.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20140220050415.GA29027@lilyforest> <CAH+w=7Z+R_ZexSkesp2z+ndooHStOGJcMeWXtD7HCunjqJp9-Q@mail.gmail.com> <firstname.lastname@example.org>
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@xxxxxxxxxxxxxxxx> wrote:
> > Although it would be better if zsh did not begin hogging the CPU, it's
> > possible for that closed descriptor to be re-opened again (e.g. by a signal
> > handler), so unless we are willing to ignore that I'm not sure what to do.
> > 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.
> Ideally we'd want to make the user aware of the error, but once per user
> input, i.e. typically a key press, is probably too often for that.
> > I don't think we want to go so far as to make it an error to pass a closed
> > fd to zle -F ... and that wouldn't help in this case anyway?
Actually there is no closed fd passed to zle -F in my case. It's closed
> I don't see any real point in testing it before we use it. I think this
> is part of the same problem of how we signal to the user their fd isn't
> working without messing up the display.
The handler can know that the fd is closed in case of 'poll': the
handler will get an argument like 'hup' or 'nval'. But it doesn't help
in this case: the handler can uninstall itself, but this only takes
effect after the for loop is done.
Messages sorted by: