Re: [pcre-dev] A question about testinput18

Top Page
Delete this message
Author: Ze'ev Atlas
Date:  
To: pcre-dev@exim.org
Subject: Re: [pcre-dev] A question about testinput18
It is 0 all the time.  Enclosed is the output file (translated to ASCII as usual) Ze'ev Atlas




      From: "ph10@???" <ph10@???>
 To: Ze'ev Atlas <zatlas1@???> 
Cc: "pcre-dev@???" <pcre-dev@???>
 Sent: Tuesday, December 29, 2015 10:30 AM
 Subject: Re: [pcre-dev] A question about testinput18


On Tue, 29 Dec 2015, Ze'ev Atlas wrote:

> Hi PhilI have a different explanation, and in order to demonstrate it
> I've sent you screen shots in a simple text file (so we won't have the
> formatting issue.)  In my opinion pcre2test complains about the first
> character after the pattern - usually the first character in the next
> line.  See lines 49-51 where it complains about the '\' or, even more
> dramatic, lines 44-45 where it complains about the 'i' modifier.Look
> at line 87-88 (I skipped many lines to the tail of the output) where
> it complains about the '\' instead of complaining about a bad escape
> sequence. Ze'ev Atlas


The file was fine for reading. I still think it is symptomatic of
looking for pattern lines when it should be expecting subject lines.
Please try this test:

1. Check that SUPPORT_PCRE2_8 is #defined in your config.h
2. Add an extra line to pcre2test.c:

while (notdone)                                                             
  {                                                                         
  uint8_t *p;                                                               
  int rc = PR_OK;                                               
  BOOL expectdata = TEST(compiled_code, !=, NULL);                       
#ifdef SUPPORT_PCRE2_8                                         
  expectdata |= preg.re_pcre2_code != NULL;                               
#endif       

fprintf(outfile, "+++expectdata=%d\n", expectdata); /* <====== Add this line */

Then compile and run pcre2test on this input:

#pattern posix

/abc/
  abc\=find_limits
 
That is, try one of the tests that fails. If the value of "expectdata"
is always 0, it supports my hypothesis and we then have to figure out
why. If the last value is 1 then something else is wrong.

Philip

--
Philip Hazel

PCRE2 version 10.21-RC1 2015-12-15
+++expectdata=0
# This set of tests is run only with the 8-bit library. It tests the POSIX
+++expectdata=0
# interface, which is supported only with the 8-bit library. This test should
+++expectdata=0
# not be run with JIT (which is not available for the POSIX interface).
+++expectdata=0

+++expectdata=0
#forbid_utf
+++expectdata=0
#pattern posix
+++expectdata=0

+++expectdata=0
# Test invalid options
+++expectdata=0

+++expectdata=0
/abc/auto_callout
** Ignored with POSIX interface: auto_callout
+++expectdata=0

+++expectdata=0
/abc/
+++expectdata=0
   abc\=find_limits
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0

+++expectdata=0
/abc/
+++expectdata=0
  abc\=partial_hard
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0

+++expectdata=0
# Real tests
+++expectdata=0

+++expectdata=0
/abc/
+++expectdata=0
    abc
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0

+++expectdata=0
/¬abc|def/
+++expectdata=0
    abcdef
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0
    abcdef\=notbol
+++expectdata=0

+++expectdata=0
/.*((abc)$|(def))/
+++expectdata=0
    defabc
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0
    defabc\=noteol
+++expectdata=0

+++expectdata=0
/the quick brown fox/
+++expectdata=0
    the quick brown fox
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0
\= Expect no match
+++expectdata=0
    The Quick Brown Fox
+++expectdata=0

+++expectdata=0
/the quick brown fox/i
** Unrecognized modifier 'i' in 'i'
+++expectdata=0
    the quick brown fox
+++expectdata=0
    The Quick Brown Fox
+++expectdata=0

+++expectdata=0
/(*LF)abc.def/
+++expectdata=0
\= Expect no match
** Invalid pattern delimiter '\' (xe0).
+++expectdata=0
    abc\ndef
+++expectdata=0

+++expectdata=0
/(*LF)abc$/
+++expectdata=0
    abc
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0
    abc\n
+++expectdata=0

+++expectdata=0
/(abc)\2/
Failed: POSIX code 6: invalid backreference number
+++expectdata=0

+++expectdata=0
/(abc\1)/
Failed: POSIX code 6: invalid backreference number
+++expectdata=0
\= Expect no match
+++expectdata=0
    abc
+++expectdata=0

+++expectdata=0
/a*(b+)(z)(z)/
+++expectdata=0
    aaaabbbbzzzz
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0
    aaaabbbbzzzz\=ovector=0
+++expectdata=0
    aaaabbbbzzzz\=ovector=1
+++expectdata=0
    aaaabbbbzzzz\=ovector=2
+++expectdata=0

+++expectdata=0
/(*ANY)ab.cd/
+++expectdata=0
    ab-cd
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0
    ab=cd
+++expectdata=0
\= Expect no match
+++expectdata=0
    ab\ncd
+++expectdata=0

+++expectdata=0
/ab.cd/s
** Unrecognized modifier 's' in 's'
+++expectdata=0
    ab-cd
+++expectdata=0
    ab=cd
+++expectdata=0
    ab\ncd
+++expectdata=0

+++expectdata=0
/a(b)c/no_auto_capture
+++expectdata=0
    abc
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0

+++expectdata=0
/a(?P<name>b)c/no_auto_capture
+++expectdata=0
    abc
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0

+++expectdata=0
/a?|b?/
+++expectdata=0
    abc
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0
\= Expect no match
+++expectdata=0
    ddd\=notempty
+++expectdata=0

+++expectdata=0
/\w+A/
+++expectdata=0
   CDAAAAB
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0

+++expectdata=0
/\w+A/ungreedy
+++expectdata=0
   CDAAAAB
** Invalid pattern delimiter ' ' (x40).
+++expectdata=0

+++expectdata=0
/\Biss\B/I,aftertext
** Unrecognized modifier 'I' in 'I'
+++expectdata=0
    Mississippi
+++expectdata=0

+++expectdata=0
/abc/\
Failed: POSIX code 5: last character is \
+++expectdata=0

+++expectdata=0
"(?(?C)"
+++expectdata=0

+++expectdata=0
/abcd/substitute_extended
** Ignored with POSIX interface: substitute_extended
+++expectdata=0

+++expectdata=0
/\[A]{1000000}**/expand,regerror_buffsize=31
Failed: POSIX code 12: out of memory
+++expectdata=0

+++expectdata=0
/\[A]{1000000}**/expand,regerror_buffsize=32
Failed: POSIX code 12: out of memory
+++expectdata=0

+++expectdata=0
# End of testdata/testinput18
+++expectdata=0