[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: BUG
From: |
Aharon Robbins |
Subject: |
Re: BUG |
Date: |
Mon, 29 Mar 2004 16:18:06 +0200 |
Greetings. Re: this:
> Date: Mon, 29 Mar 2004 15:51:39 +0300 (EEST)
> From: Vladimir Yackusha <address@hidden>
> To: address@hidden
> Subject: BUG
>
> Hi.
> I use Linux Slackware 9.1 with glibc-2.3.2, bash-2.05b, gawk-3.1.3.
>
> While compiling kernel I'm receiving next error:
> address@hidden:/usr/src/linux# make menuconfig
> rm -f include/asm
> ( cd include ; ln -sf asm-i386 asm)
> make -C scripts/lxdialog all
> make[1]: Entering directory `/usr/src/linux-2.4.25/scripts/lxdialog'
> make[1]: Leaving directory `/usr/src/linux-2.4.25/scripts/lxdialog'
> /bin/sh scripts/Menuconfig arch/i386/config.in
> Using defaults found in arch/i386/defconfig
> Preparing scripts: functions, parsingscripts/Menuconfig: line 1433: 18073
> Segmentation fault awk "$1"
> Awk died with error code 139. Giving up.
>
> I made very simple script, which repeats the error.
> This is the script:
> address@hidden:~/crush# cat Menuconfig
> #!/bin/sh
> function callawk () {
> awk "$1" || { echo "Awk died with error code $?. Giving up."; exit 1; }
> }
> function parser2()
> {
> callawk '
> BEGIN {
> parser("'config.in'","MCmenu0","1")
> }
> function parser(ifile,menu,num) {
> if (num > 0) {
> system("sleep 10")
> }
> while (getline < ifile) {
> if ($1 == "source") {
> parser($2,menu,"0")
> }
> }
> }'
> }
> parser2
> ---
> In result of running gawk with this script I received the same error:
>
> address@hidden:~/crush# sh Menuconfig
> Menuconfig: line 26: 18103 Segmentation fault awk "$1"
> Awk died with error code 139. Giving up.
> ---------
> File config.in contains:
> address@hidden:~/crush# cat config.in
>
> asdasdasdasdasdasdasdd
> source test/1.txt
>
>
> address@hidden:~/crush#
> ---------
> This is the test file(config.in) for repeating the error.
>
> File 1.txt in directory "test" does not exist.
>
> If file 1.txt is present in directory "test" this error does not appear.
> File 1.txt may be either empty or not.
This is an old, old, Old, OLD, O L D, *O*L*D* bug in the Menuconfig
script. I have tried to report it before, but apparently without
success.
If you change the while loop in parser to be:
while ((getline < ifile) > 0) {
it will work OK. What happens is that getline fails to open the
non-existant file. This returns -1, which is "true" for the
while loop. Thus gawk makes another recursive call to parser.
Gawk eventually dies due to infinite recursion.
So, it's not a gawk bug, but rather a logic error in the awk script.
Arnold
- Re: BUG,
Aharon Robbins <=
- BUG, Vladimir Yackusha, 2004/03/29