You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Linda Walsh <sa...@tlinx.org> on 2006/12/25 02:43:12 UTC

Warning: "xxx" matches null string many times in regex in Text/Wrap.pm..

I've seen this error message in the past few upgrades (~3.11, .12, .17) 
and was wondering if anyone else has seen it and knows what the problem is.

---
Dec 24 17:32:53 mailhost spamd[3320]: (?:(?<=[\s,]))* matches null 
string many times in regex; marked by <-- HERE in m/\G(?:(?<=[\s,]))* 
<-- HERE \Z/ at /usr/lib/perl5/5.8.8/Text/Wrap.pm line 47.
---

I'm guessing some configuration is messed up somewhere, but I suppose
it could be a bug in the Text/Wrap module.  I've just checked to see that
my cpan modules are up-to-date, and any with version numbers are.

Any ideas on getting rid of this message (preferably by removing the cause,
not by covering it up...:-)).


Thanks,
Linda

Re: Warning: "xxx" matches null string many times in regex in Text/Wrap.pm..

Posted by Linda Walsh <sa...@tlinx.org>.
I looked at this error and it appears to be caused by SpamAssassin passing
in an incorrect parameter to "Text::Wrap" by changing the value
of "Text::Wrap::break" to be something other than a "line breaking"
character (or characters).

In file in my Spamassassin-3.17 cpan dir, there is a bad line:

./lib/Mail/SpamAssassin/PerMsgStatus.pm:996:      $hdr = 
Mail::SpamAssassin::Util::wrap($hdr, "\t", "", 79, 0, '(?<=[\s,])');

The last argument, '(?<=[\s,])' appears to be invalid.

The error message is "(?:(?<=[\s,]))* matches null string many \
times in regex; marked by <-- HERE in m/\G(?:(?<=[\s,]))* <-- \
HERE \Z/ at /usr/lib/perl5/5.8.8/Text/Wrap.pm line 46. "

In the Text::Wrap source code of 0704 (last working version),
there is (at line 46, remarkably enough:-)), the line:

        while ($t !~ /\G\s*\Z/gc) {

In versions 0711 and later, that line reads:
        while ($t !~ /\G(?:$break)*\Z/gc) {
=====
    Note that "\s" has been replaced by "(?:$break)".  In the
0711 source code, $break defaults to '\s'.

    In other words -- it appears, from the code it replaces and
from the default values of "$break" that "$break" should contain
a pattern representing the characters to break on.

    However, in PerMsgStatus:996, we see a *zero-length*
(the "(?<=pat)" part) pattern passed in for the value of $break. 
Instead of matching the line "break" character, it only matches
the position and never matches the character itself -- thus it
gets "stuck" applying the zero-length (null pattern) again and
again (thus the message "<bad expr> matches null string many
times....".

    I'm not sure what the author was trying to do in PerMsgStatus.pm
or who "owns" that "line" (or file), but perhaps they meant for
"comma" to be included in the list of "break" characters.  In
which case, instead of:
     '(?<=[\s,])'
for the last argument in line 996, it should be:
     '[\s,]'

    That is, line 996 in lib/Mail/SpamAssassin/PerMsgStatus.pm should be:
$hdr = Mail::SpamAssassin::Util::wrap($hdr, "\t", "", 79, 0, '[\s,]');

(instead of:
$hdr = Mail::SpamAssassin::Util::wrap($hdr, "\t", "", 79, 0, '(?<=[\s,])');
)

I hope this was helpful?

Linda

---orig msg follows---

Theo Van Dinter wrote:
> On Sun, Dec 24, 2006 at 05:43:12PM -0800, Linda Walsh wrote:
>   
>> I've seen this error message in the past few upgrades (~3.11, .12, .17) 
>> and was wondering if anyone else has seen it and knows what the problem is.
>>     
> Discussed so much it's an FAQ. :

Re: Warning: "xxx" matches null string many times in regex in Text/Wrap.pm..

Posted by Linda Walsh <sa...@tlinx.org>.
Many thanks....didn't think to look in the FAQ...sigh.  I have
"local site configuration" esteem issues -- thinking it is
usually something "peculiar" to my setup.


    So it's Text::Wrap...
    I'm surprised they haven't fixed it.  Doesn't seem like it
would be that difficult as they should have a fairly large
number of "test cases" and should know what they changed...
(famous last words).

-Linda


Theo Van Dinter wrote:
> On Sun, Dec 24, 2006 at 05:43:12PM -0800, Linda Walsh wrote:
>   
>> I've seen this error message in the past few upgrades (~3.11, .12, .17) 
>> and was wondering if anyone else has seen it and knows what the problem is.
>>     
> Discussed so much it's an FAQ. :)
> http://wiki.apache.org/spamassassin/TextWrapError
>   

Re: Warning: "xxx" matches null string many times in regex in Text/Wrap.pm..

Posted by Theo Van Dinter <fe...@apache.org>.
On Sun, Dec 24, 2006 at 05:43:12PM -0800, Linda Walsh wrote:
> I've seen this error message in the past few upgrades (~3.11, .12, .17) 
> and was wondering if anyone else has seen it and knows what the problem is.

Discussed so much it's an FAQ. :)

http://wiki.apache.org/spamassassin/TextWrapError

-- 
Randomly Selected Tagline:
"It's always darkest before dawn. So if you're going to steal your
 neighbour's newspaper, that's the time to do it." - Zen Musings