zsh-workers
 help / color / mirror / code / Atom feed
* padding in vt100 causes 'make check' to hang on FreeBSD
@ 2013-12-16 15:36 Jun T.
  2013-12-16 16:33 ` Bart Schaefer
  2013-12-16 18:29 ` Axel Beckert
  0 siblings, 2 replies; 7+ messages in thread
From: Jun T. @ 2013-12-16 15:36 UTC (permalink / raw)
  To: zsh-workers

On FreeBSD, 'make check' hangs at X02zlevi.ztst (and other tests which use
comptest). The hang is at line 96 of comptest (in comptesteval()):

95:   zpty -w zsh ". $tmp"
96:   zpty -r -m zsh log_eval "*<PROMPT>*" || {

The actual problem is in the contents of the file $tmp (i.e., "$@"
of comptesteval()), in particular line 37:

37: TERM=vt100

Various capabilities of vt100 contain the ancient "padding", and FreeBSD's
slave side tputs() actually sends 'null bytes' as paddings before sending
the <PROMPT>. But the zsh on the master side just considers the 'null byte'
as the end of C-string, and the line 96 never returns.

If I change the line 37 to

37: TERM=xterm

then 'make check' doesn't hang and ends without failure (xterm doesn't
contain any padding, of course).

Is it OK to replace vt100 with xterm?
I guess xterm is 'almost' as portable as vt100, but not 100% sure.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: padding in vt100 causes 'make check' to hang on FreeBSD
  2013-12-16 15:36 padding in vt100 causes 'make check' to hang on FreeBSD Jun T.
@ 2013-12-16 16:33 ` Bart Schaefer
  2013-12-16 17:13   ` Jun T.
  2013-12-16 18:29 ` Axel Beckert
  1 sibling, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2013-12-16 16:33 UTC (permalink / raw)
  To: Jun T., zsh-workers

On Dec 17, 12:36am, Jun T. wrote:
}
} Various capabilities of vt100 contain the ancient "padding", and FreeBSD's
} slave side tputs() actually sends 'null bytes' as paddings before sending
} the <PROMPT>. But the zsh on the master side just considers the 'null byte'
} as the end of C-string, and the line 96 never returns.

I would be willing to bet this is happening because of this (README):

    The variable BAUD is no longer set automatically by the shell.
    In previous versions it was set to the baud rate reported by
    the terminal driver in order to initialise the line editor's
    compensation mechanism for slow baud rates.  However, the baud
    rate so reported is very rarely related to the limiting speed of
    screen updates on modern systems.  Users who need the compensation
    mechanism should set BAUD to an appropriate rate by hand.

Please try the following and let us know if it helps:

diff --git a/Test/comptest b/Test/comptest
index 5577209..645a963 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -35,6 +35,7 @@ comptestinit () {
 "bindkey -$comptest_keymap" \
 'LISTMAX=10000000
 TERM=vt100
+BAUD=38400
 stty columns 80 rows 24
 setopt zle
 autoload -U compinit


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: padding in vt100 causes 'make check' to hang on FreeBSD
  2013-12-16 16:33 ` Bart Schaefer
@ 2013-12-16 17:13   ` Jun T.
  2013-12-16 18:21     ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Jun T. @ 2013-12-16 17:13 UTC (permalink / raw)
  To: zsh-workers


2013/12/17 01:33, Bart Schaefer <schaefer@brasslantern.com> wrote:

> Please try the following and let us know if it helps:
> 
> +BAUD=38400

No, it doesn't work (also tried larger and smaller values for BAUD).

I didn't know the parameter BAUD, but it seems it is related with
poll/select (i.e., for reading), and does not control writing to tty.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: padding in vt100 causes 'make check' to hang on FreeBSD
  2013-12-16 17:13   ` Jun T.
@ 2013-12-16 18:21     ` Bart Schaefer
  2013-12-17  5:29       ` J. Takimoto
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2013-12-16 18:21 UTC (permalink / raw)
  To: zsh-workers

On Dec 17,  2:13am, Jun T. wrote:
} Subject: Re: padding in vt100 causes 'make check' to hang on FreeBSD
} 
} 2013/12/17 01:33, Bart Schaefer <schaefer@brasslantern.com> wrote:
} 
} > Please try the following and let us know if it helps:
} > 
} > +BAUD=38400
} 
} No, it doesn't work (also tried larger and smaller values for BAUD).

OK, then what about this instead?


diff --git a/Test/comptest b/Test/comptest
index 5577209..ad14cca 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -35,7 +35,7 @@ comptestinit () {
 "bindkey -$comptest_keymap" \
 'LISTMAX=10000000
 TERM=vt100
-stty columns 80 rows 24
+stty 38400 columns 80 rows 24
 setopt zle
 autoload -U compinit
 compinit -u


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: padding in vt100 causes 'make check' to hang on FreeBSD
  2013-12-16 15:36 padding in vt100 causes 'make check' to hang on FreeBSD Jun T.
  2013-12-16 16:33 ` Bart Schaefer
@ 2013-12-16 18:29 ` Axel Beckert
  1 sibling, 0 replies; 7+ messages in thread
From: Axel Beckert @ 2013-12-16 18:29 UTC (permalink / raw)
  To: zsh-workers

Hi,

On Tue, Dec 17, 2013 at 12:36:54AM +0900, Jun T. wrote:
> On FreeBSD, 'make check' hangs at X02zlevi.ztst (and other tests which use
> comptest). The hang is at line 96 of comptest (in comptesteval()):
> 
> 95:   zpty -w zsh ". $tmp"
> 96:   zpty -r -m zsh log_eval "*<PROMPT>*" || {

This seems the same place as where our Hurd builds hang:

../../Test/X02zlevi.ztst: starting.
make[2]: *** [check] Terminated
make[1]: *** [test] Terminated
make: *** [build-arch] Terminated
Build killed with signal TERM after 180 minutes of inactivity

Will try to get the patches proposed later in this thread tested for
the hurd builts, but it may take a while until then.

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
 X   See http://www.asciiribbon.org/              | abe@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://noone.org/abe/ (Web)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: padding in vt100 causes 'make check' to hang on FreeBSD
  2013-12-16 18:21     ` Bart Schaefer
@ 2013-12-17  5:29       ` J. Takimoto
  2013-12-17  6:06         ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: J. Takimoto @ 2013-12-17  5:29 UTC (permalink / raw)
  To: zsh-workers

On 2013/12/17, at 3:21, Bart Schaefer <schaefer@brasslantern.com> wrote:
> OK, then what about this instead?
> 
> -stty columns 80 rows 24
> +stty 38400 columns 80 rows 24

I thought it should work, but it didn't.

But I tried it again, with some trial-and-error, and have found that
it works if I reverse the order of 'TERM=vt100' and 'stty 38400'.

Is this more portable than to use xterm?


diff --git a/Test/comptest b/Test/comptest
index 5577209..10814d6 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -34,8 +34,8 @@ comptestinit () {
 "fpath=( $fpath )" \
 "bindkey -$comptest_keymap" \
 'LISTMAX=10000000
+stty 38400 columns 80 rows 24
 TERM=vt100
-stty columns 80 rows 24
 setopt zle
 autoload -U compinit
 compinit -u


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: padding in vt100 causes 'make check' to hang on FreeBSD
  2013-12-17  5:29       ` J. Takimoto
@ 2013-12-17  6:06         ` Bart Schaefer
  0 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2013-12-17  6:06 UTC (permalink / raw)
  To: zsh-workers

On Dec 17,  2:29pm, J. Takimoto wrote:
}
} But I tried it again, with some trial-and-error, and have found that
} it works if I reverse the order of 'TERM=vt100' and 'stty 38400'.

Excellent, thanks for looking at this.

} Is this more portable than to use xterm?

I believe so, because the terminal definition for xterm might not be
present if there's no graphical UI installed, but I have no direct
evidence.  Also, I don't trust that "xterm" on some platform or other
won't differ in some way that creates an even more obscure problem.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-12-17  6:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-16 15:36 padding in vt100 causes 'make check' to hang on FreeBSD Jun T.
2013-12-16 16:33 ` Bart Schaefer
2013-12-16 17:13   ` Jun T.
2013-12-16 18:21     ` Bart Schaefer
2013-12-17  5:29       ` J. Takimoto
2013-12-17  6:06         ` Bart Schaefer
2013-12-16 18:29 ` Axel Beckert

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).