[Testcode] Source regex_old.c is clearly flawed!

Mats Erik Andersson ynglingatal at comhem.se
Mon Mar 3 18:31:53 UTC 2008


Hello again folks,

I supply a test program that clearly demonstrates

     regex_old.c   of uClibc-0.9.29 

     regex.c  of uClibc-0.9.28

to be seriously disfunctional. The testprogram fails
for 11 out of 48 strings, where the new regex.c of 
uClibc-0.9.29 as well as glibc succeed.

The toolchain was constructed from binutils-2.17,
gcc-4.1.2, and uClibc-0.9.29 for i386.

The complexity of regex_old.c is to grave for me to
resolve the error on my own, but the failing strings clearly
display that the problem lies in the interplay between
repetitions "{n}" and "*" as well as "?". "+" is not
affected here. Thus the case "zero_time_ok == 1" must be
checked in repetitions.

All testing patterns are crafted to use at least strings
built from the words "ab" and "ba". The maintainer of this
code will probably find the string "baab" to provide most
insight, since it provokes most of the failures. The test
program is very verbose with test strings and patterns,
and their grouping intends to simplify visual patterns.

Best regards

M E Andersson

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_regex.c
Type: text/x-csrc
Size: 1835 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20080303/862c1f6e/attachment-0002.c 


More information about the uClibc mailing list