match function hangs

Bug #1475968 reported by Jarno Suni on 2015-07-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mawk (Ubuntu)
Undecided
Unassigned

Bug Description

Testcase:
mawk '{print match($0,/(a*)*/)}'
hangs with any input. I expect it to print an integer number for each line in input and exit thereafter.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: mawk 1.3.3-17ubuntu2
ProcVersionSignature: Ubuntu 3.13.0-57.95-lowlatency 3.13.11-ckt21
Uname: Linux 3.13.0-57-lowlatency x86_64
ApportVersion: 2.14.1-0ubuntu3.11
Architecture: amd64
CurrentDesktop: XFCE
Date: Sun Jul 19 12:00:02 2015
Dependencies:
 gcc-4.9-base 4.9.1-0ubuntu1
 libc6 2.19-0ubuntu6.6
 libgcc1 1:4.9.1-0ubuntu1
 multiarch-support 2.19-0ubuntu6.6
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-09-21 (301 days ago)
InstallationMedia: Ubuntu-Studio 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.1)
SourcePackage: mawk
UpgradeStatus: No upgrade log present (probably fresh install)

Jarno Suni (jarnos) wrote :
Jarno Suni (jarnos) wrote :

As for mawk 1.3.4 20150503,
echo bacaa | mawk '{print match($0,/(a*)*/), RLENGTH}'
prints
2 1
whereas GNU Awk 4.0.1,
echo bacaa | gawk '{print match($0,/(a*)*/), RLENGTH}'
prints
1 0

Jarno Suni (jarnos) on 2015-07-31
tags: added: wily
Jarno Suni (jarnos) wrote :

Alternative link for #2: https://github.com/ThomasDickey/original-mawk/issues/34 (This is actually different bug, and in a later version of mawk, but I guess it is somehow related.

Jarno Suni (jarnos) wrote :

mawk '{print match($0,/a*/)}'
works, but
mawk '{print match($0,/a**/)}'
does not

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.