Subject: Re: awk bug in current ?
To: None <current-users@netbsd.org>
From: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
List: current-users
Date: 03/19/2006 18:32:14
On Sun, Mar 19, 2006 at 06:07:11PM +0100, Vincent wrote:
> walt a écrit :
> >On Sun, 2006-03-19 at 17:19 +0100, Vincent wrote:
> >
> >>Hi there,
> >>I've build the current release some minutes ago, and now I get this 
> >>message:
> >>
> >>assertion "c < NCHARS" failed: file "/usr/src/dist/nawk/b.c", line 890, 
> >>function "cgoto"
> >>[1]   Abort trap (core dumped) /usr/bin/awk "/#...
> >
> >
> >I see the same (on i386):
> 
> You're right, I omitted to add that I was running current on i386.
> Worse, with that broken awk, I cannot build the system anymore:
> 
> install ===> gnu/usr.bin/groff/src/utils/indxbib
> assertion "c < NCHARS" failed: file "/usr/src/dist/nawk/b.c", line 890, 
> function "cgoto"
> [1]   Abort trap (core dumped) awk -F"\"" "/COM...
> nbmake: "/usr/src/gnu/usr.bin/groff/src/utils/indxbib/Makefile" line 13: 
> warning: "awk -F\" '/COMMON_WORDS_FILE/ { print $2 }' 
> /usr/src/gnu/usr.bin/groff/src/utils/indxbib/../../include/defs.h" 
> returned non-zero status

And it looks real broken: I got the same with this backtrace:

    #3  0x0804de1e in cgoto (f=0x8077000, s=2, c=261) at b.c:891
    #4  0x0804bd69 in makeinit (f=0x8077000, anchor=0) at b.c:168
    #5  0x0804bbf1 in mkdfa (s=0x80751c0 "COMMON_WORDS_FILE", anchor=0) at b.c:144
    #6  0x0804b8dc in makedfa (s=0x80751c0 "COMMON_WORDS_FILE", anchor=0) at b.c:93
    #7  0x0804a56d in yyparse () at awkgram.y:282
    #8  0x0805223a in main (argc=1, argv=0xbfbfeb64) at main.c:155
    #9  0x08049316 in ___start ()

b.c:168

    f->curstat = cgoto(f, 2, HAT);

b.c:890

    assert(c < NCHARS);	  // c == HAT == NCHARS+2
    f->gototab[s][c] = i; // defined as: uschar  gototab[NSTATES][NCHARS];

As b.c contains:

    #define HAT     (NCHARS+2)      /* matches ^ in regular expr */
				    /* NCHARS is 2**n */

maybe it was meant as `#define HAT 258'?

-- 
Juergen Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)