From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29699 invoked from network); 27 Feb 2009 16:35:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Feb 2009 16:35:47 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 58312 invoked from network); 27 Feb 2009 16:35:43 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Feb 2009 16:35:43 -0000 Received: (qmail 5680 invoked by alias); 27 Feb 2009 16:35:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26625 Received: (qmail 28301 invoked from network); 27 Feb 2009 16:20:38 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 27 Feb 2009 16:20:38 -0000 Received: from moulinette.org (moulinette.org [87.98.217.87]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 836D58058F83 for ; Fri, 27 Feb 2009 17:20:35 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by moulinette.org (Postfix) with ESMTP id 91FE9AF3 for ; Fri, 27 Feb 2009 17:20:28 +0100 (CET) Received: from moulinette.org ([127.0.0.1]) by localhost (moulinette.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8hxZhD4dnMMv for ; Fri, 27 Feb 2009 17:20:27 +0100 (CET) Received: from localhost (fw.elexo.fr [81.255.193.109]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by moulinette.org (Postfix) with ESMTP id 3AA28AF1 for ; Fri, 27 Feb 2009 17:20:27 +0100 (CET) Date: Fri, 27 Feb 2009 17:20:25 +0100 From: Lionel Flandrin To: zsh-workers@sunsite.dk Subject: zsh 4.3.9: Interrupted "tcsetattr" call problem, tiling-wm related Message-ID: <20090227161933.GE4173@shame.elexo.fr.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.92.1/9054/Fri Feb 27 10:02:52 2009 on bifrost X-Virus-Status: Clean Hi everybody, I haven't subscribed to this list so please include me in Cc in your replies. I think I have spotted a bug related to this one: http://www.zsh.org/mla/workers/2007/msg01121.html Basically, *sometimes* I get an unusable prompt when I start a new terminal, if I type I get a litteral tab, if I type "key up" I get ^[[A etc... A strace told me the problem is that the terminal bufferizes the output line by line, i.e. is in ICANON termios mode. A couple of grep and dirty fprintf in the source code later, I think I've found the root of the problem at Src/utils.c line 1440: 1440 tcsetattr(SHTTY, TCSADRAIN, &ti->tio); 1441 /* if (tcsetattr(SHTTY, TCSADRAIN, &ti->tio) == -1) */ (It's interresting that the bugfix is almost already there :). Indeed, the problem seems to be that I use a tiling WM (stumpwm) that resizes the term as soon as it's created, sending (I'm just guessing there) the SIGWINCH signal to zsh interrupting the tcsetattr. If I add some debug code: while (tcsetattr(SHTTY, TCSADRAIN, &ti->tio) == -1) { FILE *f = fopen("/tmp/fail.out", "a"); fprintf(f, "tcsetattr failed: %s\n", strerror(errno)); fclose(f); } I do get: "tcsetattr failed: Interrupted system call" If I change the call to: while (tcsetattr(SHTTY, TCSADRAIN, &ti->tio) == -1 && errno == EINTR); It fixes the problem. I hope this helps. (Thank to ft on freenode's #zsh for his help). -- Lionel Flandrin