bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: /dev/fd/n bug in gawk 3.1.5


From: Andrew J. Schorr
Subject: Re: /dev/fd/n bug in gawk 3.1.5
Date: Mon, 3 Jul 2006 16:11:21 -0400
User-agent: Mutt/1.4.2.1i

Hi Arnold,

> > From: "John H. DuBois III" <address@hidden>
> >
> > $ cat /dev/fd/4 /dev/fd/5 4<tm1 5<tm2
> > Contents of tm1
> > Contents of tm2
> > $ gawk 1 /dev/fd/4 /dev/fd/5 4<tm1 5<tm2
> > Contents of tm1
> > Contents of tm1
> >
> >
> > gawk: (FILENAME=/dev/fd/5 FNR=3) fatal: error reading input file 
> > `/dev/fd/4': Bad file number
> 
> The bug fix I posted yesterday was incomplete. It solved the command line 
> problem
> but (as I suspected) bugs were still lurking, as shown by this test program.

I'm afraid there still may be trouble.  Jurgen Kahrs noticed that "make check"
now fails.  With gawk 3.1.5 plus the patch, it fails on the pid test:

bash-3.00$ ./gawk -f test/pid.awk
gawk: test/pid.awk:28: warning: use `PROCINFO["pid"]' instead of `/dev/pid'
gawk: test/pid.awk:28: warning: could not open `/dev/pid', mode `r'
gawk: test/pid.awk:28: fatal error: internal error
Aborted

And valgrind reports:

bash-3.00$ valgrind ./gawk -f test/pid.awk
...
==16089== 
gawk: test/pid.awk:28: warning: use `PROCINFO["pid"]' instead of `/dev/pid'
gawk: test/pid.awk:28: warning: could not open `/dev/pid', mode `r'
==16089== Invalid read of size 8
==16089==    at 0x4264AA: do_getline (io.c:2292)
==16089==    by 0x439984: r_tree_eval (eval.c:994)
==16089==    by 0x43B279: interpret (eval.c:877)
==16089==    by 0x43B57F: interpret (eval.c:477)
==16089==    by 0x43B3D5: interpret (eval.c:456)
==16089==    by 0x42821C: main (main.c:591)
==16089==  Address 0x20 is not stack'd, malloc'd or (recently) free'd
gawk: test/pid.awk:28: fatal error: internal error
==16089== 

Regards,
Andy




reply via email to

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