Package: gawk
Version: 1:3.1.5.dfsg-4
Severity: important


-- System Information:
Debian Release: 4.0
  APT prefers etch
  APT policy: (500, 'etch'), (90, 'etch-proposed-updates')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages gawk depends on:
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries

gawk recommends no packages.

-- no debconf information

How to reproduce the error:

(
   for r in '$' 'x*' 'x*$' 'x+$'
   do
      for s in '' ab abc abx
      do
         for i in 1 2; do echo "$r" "$s"; done
      done
   done
) | gawk '{ print "/" $1 "/ matches the string <" $2 "> at position " 
match($2,$1); }' | pr -t -n' 2'
 1 /$/ matches the string <> at position -1208945415
 2 /$/ matches the string <> at position 134852921
 3 /$/ matches the string <ab> at position 17
 4 /$/ matches the string <ab> at position 17
 5 /$/ matches the string <abc> at position 66
 6 /$/ matches the string <abc> at position 66
 7 /$/ matches the string <abx> at position 66
 8 /$/ matches the string <abx> at position 66
 9 /x*/ matches the string <> at position 1
10 /x*/ matches the string <> at position 134852921
11 /x*/ matches the string <ab> at position 1
12 /x*/ matches the string <ab> at position 1
13 /x*/ matches the string <abc> at position 1
14 /x*/ matches the string <abc> at position 1
15 /x*/ matches the string <abx> at position 1
16 /x*/ matches the string <abx> at position 1
17 /x*$/ matches the string <> at position 1
18 /x*$/ matches the string <> at position 134854177
19 /x*$/ matches the string <ab> at position 3
20 /x*$/ matches the string <ab> at position 3
21 /x*$/ matches the string <abc> at position 66
22 /x*$/ matches the string <abc> at position 66
23 /x*$/ matches the string <abx> at position 3
24 /x*$/ matches the string <abx> at position 3
25 /x+$/ matches the string <> at position 0
26 /x+$/ matches the string <> at position 0
27 /x+$/ matches the string <ab> at position 0
28 /x+$/ matches the string <ab> at position 0
29 /x+$/ matches the string <abc> at position 0
30 /x+$/ matches the string <abc> at position 0
31 /x+$/ matches the string <abx> at position 3
32 /x+$/ matches the string <abx> at position 3

Note, that each combination of a regular expression and a string
is tested twice, to demonstrate some randomness in the
calculation.

Wrong position values occur in the following output lines:

line#   expected        returned
        position        position
1       1               -1208945415
2       1               134852921
3       3               17
4       3               17
5       4               66
6       4               66
7       4               66
8       4               66
10      1               134852921       Why is line #9 right?
18      1               134854177       Why is line #17 right?
21      4               66
22      4               66

Note that all examples with regular expression /x+$/ are right.

Maybe this bug is related to #385869?
Regards, Friedhelm.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to