Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
It seems that I find a zle -F full CPU bug
- X-seq: zsh-users 18495
- From: lilydjwg <lilydjwg@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: It seems that I find a zle -F full CPU bug
- Date: Thu, 20 Feb 2014 13:04:15 +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:mime-version:content-type :content-disposition:disposition-notification-to:user-agent; bh=MBoE5EBsAGGVoMmB611Dp+QSDlRFc8hONPV5d1GDLu0=; b=GpTxVtLI0KGzaMjHKe5Q17EoGl4rIlLj5yk8C1d707TdDwjgXy7dtkmAOwu0g7mG8X 3ADDFBG0usPwJzIz2D53QfkHZU401TCEqEF/v7kR7u/avifp8Rfl91Ze1meRI+dZ2xMt wdk4aaxoMiYLTlvM4b0v8O8yr+Yh6xre4yKdOqeZHVnofsu+XM7gBS8pnwMEM4bz80Bt yqMO+Q1Ye3FD9HoaiwDKZonbVbnZjsJQChoteTLzet2yTqM4DUAob5QXHW/u9WInh1ta SjKNKRytK4+GY8A/1RSeEkGTUjvzt7QlV4nP+98kS79Bg/du30ArY701cdfXJ5uwuecg V8sQ==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hi there,
I get to know "zle -F" from the mail by Bart Schaefer[1], but it seems
that I find a bug in zle.
I use similar code to achieve the background updating, but after the
update and *before* I type anything into zsh again, zsh is busy poll the
coprocess's file descriptor, which has been invalid.
I've checked Src/Zle/zle_main.c and see a "for(;;)" loop. That loop will
break only when no fds are ready, or the user types something. So,
before the user types something and after the watched fd becomes
invalid, zsh keeps poll that fd and gets lots of POLLNVAL.
You can type the following to reproduce this:
print_and_close () {
print $*
zle -F $1
exec {1}>&-
}
coproc echo "a"
exec {test}<&p
zle -F $test print_and_close
Now zsh is eating a lot of CPU. Type anything and it will become normal
again.
I'm using zsh 5.0.5 on Arch Linux x86_64.
[1]: http://www.zsh.org/mla/users/2014/msg00204.html
--
Best regards,
lilydjwg
Messages sorted by:
Reverse Date,
Date,
Thread,
Author