[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Infinite loop generating terminfo.5 with bash 2.05

From: Thomas Dickey
Subject: Re: Infinite loop generating terminfo.5 with bash 2.05
Date: Wed, 29 Aug 2001 18:35:11 -0400
User-agent: Mutt/1.2.5i

On Wed, Aug 29, 2001 at 04:10:41PM -0600, Samuel Mikes wrote:
> >> Hi there,
> >> 
> >> I got an infinite loop while running MKterminfo.sh; read kept
> >> returning '.ad'.  Below is the change I made to work around it.
> >> My system is:
> Thomas> that's odd (is it a bug in bash?  - I'm using bash 2.04 which
> Thomas> is ok, though I recall that early bash2's were badly broken).
> Thomas> Or maybe it's a problem with the sed script that feeds it.
> Thomas> I'd first check to see what the sed script produces in
> Thomas> $unsorted, to see if that's the problem.
> $unsorted was finite. :)  Here's the tail end of both unsorted and
> sorted, from a suspended make:

something's broken (but I don't know what).  Now that you're talking
about it, I can vaguely recall some issue with read along those lines
(perhaps it's one of those cases where bash is being changed to match
bugs in some other shell - e.g., Korn shell).  I've built with several
sh's over the past year though, and haven't encountered that problem.

> address@hidden:/mnt/hdc3/src/ncurses-5.2/man$ tail -3 unsorted2494
> set_pglen_inch          slength sL      T{YI Set page length to #1 hundredth 
> of an inchT}
> .TE
> .ad
> address@hidden:/mnt/hdc3/src/ncurses-5.2/man$ tail sorted2494
> .ad
> .ad
> .ad
> .ad
> .ad
> .ad
> .ad
> .ad
> .ad
> .ad

my sorted file doesn't end that way (so there's more than one problem):

enter_horizontal_hl_mode        ehhlm   Xh      T{.Enter horizontal highlight mo
enter_left_hl_mode      elhlm   Xl      T{.Enter left highlight mode.T}
enter_low_hl_mode       elohlm  Xo      T{.Enter low highlight mode.T}
enter_right_hl_mode     erhlm   Xr      T{.Enter right highlight mode.T}
enter_top_hl_mode       ethlm   Xt      T{.Enter top highlight mode.T}
enter_vertical_hl_mode  evhlm   Xv      T{.Enter vertical highlight mode.T}
set_a_attributes        sgr1    sA      T{.Define second set of video attributes
set_pglen_inch  slength sL      T{.YI Set page length to #1 hundredth of an inch

> It's definitely consistent behavior in bash (different file,
> different version) -- at least on my box.  Apparently, read doesn't
> change the value of 'data' unless it's successful, so the 'test -z'
> never succeeds.  See below:
> address@hidden:/tmp$ cat > test-bash
> foo
> bar
> baz
> address@hidden:/tmp$ while true; do read data; test -z "$data" && break; done 
> < test-bash
> <interrupted by ^C>
> address@hidden:/tmp$ while read data; do test -z "$data" && break; done < 
> test-bash
> address@hidden:/tmp$
> The similar test with an 'echo -n $data' in the loop yields
> foobarbazbazbaz... for case 1, and foobarbaz in case 2. 
> >> GNU bash, version 2.05.0(1)-release (i486-pc-linux-gnulibc1) Linux
> >> kernel 2.0.36 (Slackware dist)

hmm - odd combination (new bash, old kernel)
>   I also tested both my test files and MKterminfo.sh with an old
> version of bash (1.13.1), and got the same results as with 2.05.
>   Could it be something in the C library?  The one I have is
> antique. 

that could be it (but I'm still running a Slackware 3.6 w/o problems)

Thomas E. Dickey <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]