octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51589] crash on regexp


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #51589] crash on regexp
Date: Fri, 28 Jul 2017 00:14:22 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #8, bug #51589 (project octave):

I've tried pcre_dfa_exec().  Unfortunately, it isn't 100% compatible with
pcre_exec(), i.e., Perl.  And probably one of the few spots they differ is the
'+'.  It's strange, for length 3 input buffer, i.e., "aaa", it works:


octave:11> [S, E, TE, M, T, NM, SP] = regexp (subject, pattern);
octave:12> M
M =
{
  [1,1] = aaa
}
octave:13> T
T =
{
  [1,1] =
  {
    [1,1] = aa
    [1,2] = a
  }

}


but anything larger produces


octave:15> [S, E, TE, M, T, NM, SP] = regexp (subject, pattern);
error: out of memory or dimension too large for Octave's index type


The reason is that the number of matches returned by pcre_dfa_exec() is zero
(i.e., non-valid dimension).

The "(a)" pattern seems to produce the same result for large input buffer
size, but I'm just noticing now that pcre_exec is slightly different than the
above result:


octave:1> subject = repmat ('a', 1, 3);
octave:2> pattern = '(a)+';
octave:3> [S, E, TE, M, T, NM, SP] = regexp (subject, pattern);
octave:4> M
M =
{
  [1,1] = aaa
}
octave:5> T
T =
{
  [1,1] =
  {
    [1,1] = a
  }

}


Well, I have no faith in switching to the pcre_dfa_exec() given the
differences.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51589>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]