[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Weird behavior (gawk 3.0.4, 3.0.6, 3.1.0)
From: |
Peter Seebach |
Subject: |
Weird behavior (gawk 3.0.4, 3.0.6, 3.1.0) |
Date: |
Wed, 07 Nov 2001 13:58:15 -0600 |
Hi! I can't figure out whether this is yours or ours. gawk (3.0.4 in our
current distribution) periodically does very surprising things. e.g.:
---
$ ./gawk '/^foo$/ {print $1}' < /usr/share/dict/web2
cystoepiplocele
foo
---
This behavior is sporadic; some runs are fine, others fail. I've tried gawk
3.0.4, 3.0.6, and 3.1.0. Other programs seem to run fine, and the machine
has ECC memory, so I'm *assuming* it's not hardware; furthermore, we had a
brief rash of this happening on a number of boxes.
When I compiled gawk 3.0.4 with -DDEBUG=1, it failed:
$ ./gawk '/^foo$/ { print $1 }' /usr/share/dict/web2
gawk: fatal: internal error line 207, file: node.c
This failure is repeatable.
3.1.0 doesn't fail with that. Output with -DDEBUG=1 is enclosed. I can't
figure out how this can be happening. I did try linking with Electric Fence,
and I get exactly the same results, so I'm uninclined to suspect a simple
malloc problem; I would have expected a different failure mode.
Any help/feedback/advice would be appreciated. Oddly, this *doesn't* seem
to happen on all of the machines I have access to, even ones where all the
libraries and binaries involved md5 the same. I don't really think this is
necessarily yours, but I'm a bit at sea here, and I don't know my way through
gawk well enough to debug it.
dfamust:
0:BEGLINE 1:f 2:CAT 3:o 4:CAT 5:o 6:CAT 7:ENDLINE 8:CAT 9:END 10:CAT
node: 0:BEGLINE
in:
is: ""
left: ""
right: ""
node: 1:f
in: "f"
is: "f"
left: "f"
right: "f"
node: 2:CAT
in: "f"
is: ""
left: ""
right: "f"
node: 3:o
in: "o"
is: "o"
left: "o"
right: "o"
node: 4:CAT
in: "fo"
is: ""
left: ""
right: "fo"
node: 5:o
in: "o"
is: "o"
left: "o"
right: "o"
node: 6:CAT
in: "foo"
is: ""
left: ""
right: "foo"
node: 7:ENDLINE
in:
is: ""
left: ""
right: ""
node: 8:CAT
in: "foo"
is: ""
left: ""
right: ""
dfaanalyze:
0:BEGLINE 1:f 2:CAT 3:o 4:CAT 5:o 6:CAT 7:ENDLINE 8:CAT 9:END 10:CAT
node 0:BEGLINE
nullable: no
firstpos: 0:BEGLINE
lastpos: 0:BEGLINE
node 1:f
nullable: no
firstpos: 1:f
lastpos: 1:f
node 2:CAT
nullable: no
firstpos: 0:BEGLINE
lastpos: 1:f
node 3:o
nullable: no
firstpos: 3:o
lastpos: 3:o
node 4:CAT
nullable: no
firstpos: 0:BEGLINE
lastpos: 3:o
node 5:o
nullable: no
firstpos: 5:o
lastpos: 5:o
node 6:CAT
nullable: no
firstpos: 0:BEGLINE
lastpos: 5:o
node 7:ENDLINE
nullable: no
firstpos: 7:ENDLINE
lastpos: 7:ENDLINE
node 8:CAT
nullable: no
firstpos: 0:BEGLINE
lastpos: 7:ENDLINE
node 9:END
nullable: no
firstpos: 9:END
lastpos: 9:END
node 10:CAT
nullable: no
firstpos: 0:BEGLINE
lastpos: 9:END
follows(1:f): 3:o
follows(3:o): 5:o
follows(5:o): 7:ENDLINE
follows(9:END):
Compiling pattern: ^foo$
Compiled pattern:
0: /begline
1: /exactn/3/f/o/o
6: /endline
7: end of pattern.
7 bytes used/32 bytes allocated.
re_nsub: 0 regs_alloc: 0 can_be_null: 0 newline_anchor: 1
no_sub: 0 not_bol: 0 not_eol: 0 syntax: 13b04d
Compiling pattern:
+
Compiled pattern:
0: /exactn/1/
3: /dummy_failure_jump to 9
6: /on_failure_jump to 15
9: /exactn/1/
12: /maybe_pop_jump to 6
15: end of pattern.
15 bytes used/32 bytes allocated.
re_nsub: 0 regs_alloc: 0 can_be_null: 0 newline_anchor: 1
no_sub: 0 not_bol: 0 not_eol: 0 syntax: 13b04d
foo
yachtsmanship
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Weird behavior (gawk 3.0.4, 3.0.6, 3.1.0),
Peter Seebach <=