Blame test/arynocls.awk

Packit 575503
#To: bug-gnu-utils@gnu.org
Packit 575503
#From: Kristján Jónasson <kristjan@decode.is>
Packit 575503
#Subject: Gawk bug
Packit 575503
#Cc: arnold@gnu.org
Packit 575503
#
Packit 575503
#Hi!
Packit 575503
#
Packit 575503
#The following seems to be a bug in gawk. I have tried as I could to
Packit 575503
#minimize the bug-causing program, so of course it does not seem to do
Packit 575503
#anything useful in its present form. The error message received is:
Packit 575503
#
Packit 575503
#gawk: test.awk:15: fatal error: internal error
Packit 575503
#Aborted
Packit 575503
#
Packit 575503
#Note that there is an attached file that the program reads, called "a". I
Packit 575503
#played with the program a fair bit and my feeling is that the error is
Packit 575503
#related with the delete statement, and not the reading of the file and the
Packit 575503
#close statement. At one point I was able to remove the file reading and
Packit 575503
#still obtain the error. If, for example, I remove the close statement and
Packit 575503
#make two copies of the file instead, (reading one copy in sub1 and the
Packit 575503
#other in sub2), the error still occurs.
Packit 575503
#
Packit 575503
#The operating system is Red Hat Linux, version 6.0, the gawk is version
Packit 575503
#3.0.4, and the gawk was obtained from an rpm file gawk-3.0.4-1.i386.rpm.
Packit 575503
#
Packit 575503
#The program is:
Packit 575503
#
Packit 575503
Packit 575503
# Wed Mar  8 13:41:34 IST 2000
Packit 575503
# ADR: modified to use INPUT, so can set it from command line.
Packit 575503
#      When run, no output is produced, but it shouldn't core
Packit 575503
#      dump, either.
Packit 575503
#
Packit 575503
# The program bug is to not close the file in sub2.
Packit 575503
Packit 575503
function sub1(x) {
Packit 575503
# while (getline < "a" == 1) i++
Packit 575503
  while (getline < INPUT == 1) i++
Packit 575503
# close("a")
Packit 575503
  close(INPUT)
Packit 575503
}
Packit 575503
Packit 575503
function sub2(x) {
Packit 575503
  i=0
Packit 575503
  delete y
Packit 575503
# while (getline < "a" == 1) z[++i] = $1
Packit 575503
  while (getline < INPUT == 1) z[++i] = $1
Packit 575503
  for(i in z) y[i] = x[i] + z[i]
Packit 575503
}
Packit 575503
Packit 575503
function sub3(x, y, z) {
Packit 575503
  sub2(x)
Packit 575503
  for(i=1; i<=4; i++) z[i] = y[i]
Packit 575503
}
Packit 575503
Packit 575503
BEGIN {
Packit 575503
  sub1(x)
Packit 575503
  sub2(x)
Packit 575503
  sub3(x, y, z)
Packit 575503
}
Packit 575503
#
Packit 575503
#And the data file is:
Packit 575503
#
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
# 32.440    3.830    3.383700000000000    10.08    298  865
Packit 575503
#
Packit 575503
#