From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8119 invoked by alias); 23 Nov 2014 09:07:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33770 Received: (qmail 18504 invoked from network); 23 Nov 2014 09:07:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1416733247; bh=PX3gN8dWjoDuBBlBdEV0y1NFURelst5w81Em7wl3yFQ=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=ZRhSKJR1vRndWJZuUhW9UYq/jZq02Q74yvvCJDC6/+P3AcBL6klgFcdR6xvg8s7DBLm4fYVjW5Yx+ebr6wBoFnDMwzv539QuOpr6iRqYvyivte36QbV7p8FOvM7Kk8Q6NJIIk5fmhcYAg4KoxWw7rUsjLUBMhwXibKoomCkPN9UNNhkKBIKbSltoZBA+RpHlr59a3JIpQN7ipIgPAmpETJsM27tsWeW71734yKGxwF4EBvfa0WV90m692QtcDFF9em20pAZM0czRTCjuj3OWhWCMMQAvfrKn6r8aX5BhZAQry7qU14MsVIkxuWG3yNB8NKzPyqaKTOrZVWYbH7bxYA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.co.uk; b=VBJWL/a2WBvojLHlY5cEAo+wcKrBraP0Gt2ZUuAAOCvj69+NlXRtNR4gZIHQfWcDRwAemZRJn9sEdi5Yic0ljXbiVq5+SPGLaocClkE1wc+/nasoGw96R9nwVT4cHST8a9D6o2Q7iL55VJKRblGwN8yHvwiz4tR1vstDrmFZ39KkQP4W+BG/3O8kJyRHIzwGRYwH43bTI41dpODvib8oLqzCB5y19Ux1o+1TrOND5Ep4+SqZ3K4Ul98uXP99ReUpK39aStBEUrneZOXnESwiqkVWnqhRt3W/o7NjlgRMhNp5p+L3e/34ipWn6B3vgSYgE3VWaBmc3cSfyviXWnuQVQ==; X-Yahoo-Newman-Id: 965426.29879.bm@smtp145.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: gFND7uwVM1n7QSXwm3WiKSdxUenPbsOrDANkijGRrFvRSjd 2_nWCLvNZnCgx1lrqhqkK9bzZK83dUS_C38YgI69bFm3Oz3w.JhnX6YAsPXj vGDMnBQUifVHV3Rs.TtAIqgoZ0u2uieuK1Todgxs2FWov7HTZRycVgOsEmNi 9JFbXZlwxMt6o.Uu9ydv2OzPXR0dkAf0pdAkwku8MWa82kM6c7EVlaQZhcmh ATdczuk2zl1GjZUcs0G3tIc1iHmq6482IWWbMoE1JMQBYDFraZH7iB4Pm0Kk _qjMxTRYsUlkoZrESailkoJEQYCj6DDv0KVncvA0LgaP2lCLJo5crTWbeu7y QlQveiY5NET3SGpy7R0BBJmJof4TVovCkSZFHxVr2K.LVi79FGHdbFZ71GbE hq5T2tba9lSSUC_ywTihj6eUC039NrvIac9j4qP6eiXoPXD0VQQxc5H4UUdV E5kts.hjMU.tGGQrESapNT6LOIdsCcnTfx0KbInXgPrCMbwCJ7Bf8F.DJ1DA WTy5Mi5MhchqSc2Yl_WFIODq1F8zkFA-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <2D312191-3B6F-49BE-9289-95DDA6DAC1F4@kba.biglobe.ne.jp> From: Oliver Kiddle References: <141119085006.ZM18951@torch.brasslantern.com> <11014.1416438322@quattro> <141119222019.ZM2717@torch.brasslantern.com> <5A1A98B7-42E0-4EE1-9468-32E2D6434246@kba.biglobe.ne.jp> <141120091803.ZM3693@torch.brasslantern.com> <2D312191-3B6F-49BE-9289-95DDA6DAC1F4@kba.biglobe.ne.jp> To: zsh-workers@zsh.org Subject: Re: Confirming X02zlevi test failures MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13276.1416733245.1@thecus.kiddle.eu> Date: Sun, 23 Nov 2014 10:00:45 +0100 Message-ID: <13277.1416733245@thecus.kiddle.eu> "Jun T." wrote: > If I commented out 'zpty_flush After zletest', then 2/1000 failed. > Then I changed 'read -t 0.011' to 'read -t 0.02' and got 1000/1000 success. One thing to be wary of when using the vi test is that there is no counter test in there: we don't have a test of username completion on \e~ with a suitable lack of delay between the two keystrokes. If we can make it work, we should probably have two earlier tests explicitly testing KEYTIMEOUT. Bart wrote: > I begin to suspect that what needs to happen is that zpty needs to be a > lot more aggressive internally about consuming (and buffering up) the > slave output as fast as it appears I decided to see if I could reproduce the problem using expect. The results somewhat convince me that tweaking zpty isn't going to help. With expect it is easier to adjust the delays and parameters. But the results aren't always making much sense, either on Linux or BSD. On Linux, switching between precisely 1000 and 999 micro seconds was making a difference. I've attached the expect script. The second parameter to send_slow and -s option to send control the delays but other, seemingly innocuous, changes can also make a difference. > The second thing I found is that, possibly for the same reason, the > delayzetterm flag is (inconsistently in terms of zletest input, but > consistently for this particular test) getting set, which causes > KEYTIMEOUT to be ignored. The comment for delayzetterm says: I've been looking at this too. I noticed instances where the FIONREAD in getbyte() was returning 0, it then called zsetterm again which does another FIONREAD ioctl but received a value of 5. There's an unavoidable race condition if we can't stop more characters coming in between the FIONREAD and the settyinfo. Even so, it seems a bit pointless to do the ioctl twice. I've attached a patch to make getbyte just call zsetterm again and rely on it trying the ioctl again. Not that this helps us much. Are you just using strategically placed dputs for instrumentation? I seem to get nothing from them after the terminal has been configured. truss/ltrace are not much use. dtrace is just hanging for me but I've never tried it on BSD before. I'll try gdb with a command file. I've just realised on reading the e-mail before sending that the dtrace problem is because the prompt is # for root instead of the % that expect is expecting. I couldn't find a way to enable it for a normal user on BSD. Oliver diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index d157e36..a38f55b 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -238,9 +238,9 @@ zsetterm(void) * we can't set up the terminal for zle *at all* until * we are sure there is no more typeahead to come. So * if there is typeahead, we set the flag delayzsetterm. - * Then getbyte() performs another FIONREAD call; if that is - * 0, we have finally used up all the typeahead, and it is - * safe to alter the terminal, which we do at that point. + * Then getbyte() calls here to performs another FIONREAD call; + * if that is 0, we have finally used up all the typeahead, and + * it is safe to alter the terminal, which we do at that point. */ delayzsetterm = 1; return; @@ -884,12 +884,8 @@ getbyte(long do_keytmout, int *timeout) ret = STOUC(kungetbuf[--kungetct]); else { #ifdef FIONREAD - if (delayzsetterm) { - int val; - ioctl(SHTTY, FIONREAD, (char *)&val); - if (!val) - zsetterm(); - } + if (delayzsetterm) + zsetterm(); #endif for (;;) { int q = queue_signal_level(); #