Tags:
create new tag
view all tags

SID-01595: infinite loop pattern in Webnotify

Status: Answered Answered TWiki version: 5.1.2 Perl version: 5.014002 (linux)
Category: CategoryEmail Server OS: Linux 2.6.42-26-generic (x86_64-linux-gnu-thread-multi) Last update: 13 years ago

Created a cron job for notifications but am getting the following error


(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:))))))))))))))))))))))+ matches null string many times in regex; marked by <-- HERE in m/^\s+\*\s(?^l:(?:Main\.)?)((?^::upper:+:digit:+:upper:+:digit:*))\s+\-\s+((?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:))))))))))))))))))))))+ <-- HERE )\s*$/ at /var/www/twiki/lib/TWiki/Contrib/MailerContrib/WebNotify.pm line 360 (#1) (W regexp) The pattern you've specified would be an infinite loop if the regular expression engine didn't specifically check for that. The <-- HERE shows in the regular expression about where the problem was discovered. See perlre.

[Thu Nov 29 18:05:01 2012] mailnotify: (?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:))))))))))))))))))))))+ matches null string many times in regex; marked by <-- HERE in m/^\s+\*\s(?^l:(?:Main\.)?)((?^::upper:+:digit:+:upper:+:digit:*))\s+\-\s+((?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:))))))))))))))))))))))+ <-- HERE )\s*$/ at /var/www/twiki/lib/TWiki/Contrib/MailerContrib/WebNotify.pm line 360.


-- LeoList - 2012-11-29

Discussion and Answer

command in cron is

5 * * * * cd /var/www/twiki && perl -I bin tools/mailnotify -q

-- LeoList - 2012-11-29

Not sure, but it might be related to this: I have seen in certain environments (don't know which ones, may be Perl version?) where the configure script adds a strange (?^: ... ) sequence to some variables each time the configure values are saved. Compare twiki/lib/LocalSite.cfg with the default values in twiki/lib/TWiki.spec.

-- PeterThoeny - 2012-11-30

This seems to be Perl 5.14 related. I created TWikibug:Item7067 to track this.

-- PeterThoeny - 2012-11-30

Please apply patch posted at TWikibug:Item7067, run configure, save a change, and let me know if this fixes the issue.

-- PeterThoeny - 2012-11-30

Ok. applied the patch; unfortunately i t made no difference (at least not initially).

Searched a bit more and found that a new installation had a different mailercontrib emailfilter

On the site with the infinite loop it was (?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:))))))))))))))))))))))))))))

On the new site (fresh install) it was (?^:(?^:(?^:(?^:(?^:(?^:))))))

When I deleted the filter altogether the infinite loop disappeard; now I don't know if this is due to the filter or the patch, but its better. I do howeber get this message


(?^:(?^:))+ matches null string many times in regex; marked by <-- HERE in
m/^\s+\*\s(?^l:(?:Main\.)?)((?^::upper:+:digit:+:upper:+:digit:*))\s+\-\s+((?^:(?^:))+ <-- HERE )\s*$/ at /var/www/twiki/lib/TWiki/Contrib/MailerContrib/WebNotify.pm line 360 (#1)
(W regexp) The pattern you've specified would be an infinite loop if the
regular expression engine didn't specifically check for that. The <-- HERE
shows in the regular expression about where the problem was discovered.
See perlre.

[Mon Dec 3 12:00:01 2012] mailnotify: (?^:(?^:))+ matches null string many times in regex; marked by <-- HERE in m/^\s+\*\s(?^l:(?:Main\.)?)((?^::upper:+:digit:+:upper:+:digit:*))\s+\-\s+((?^:(?^:))+ <-- HERE )\s*$/ at /var/www/twiki/lib/TWiki/Contrib/MailerContrib/WebNotify.pm line 360.


BTW, clearing the filer and saving the config makes the filter (?^:(?^:))next time I come in

-- LeoList - 2012-12-03

Do you need more info. I'm still getting this warning, but emails are sent anyway


(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:))))))))))+ matches null string many times in regex; marked by <-- HERE in m/^\s+\*\s(?^l:(?:Main\.)?)((?^::upper:+:digit:+:upper:+:digit:*))\s+\-\s+((?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:))))))))))+ <-- HERE )\s*$/ at /var/www/twiki/lib/TWiki/Contrib/MailerContrib/WebNotify.pm line 360 (#1) (W regexp) The pattern you've specified would be an infinite loop if the regular expression engine didn't specifically check for that. The <-- HERE shows in the regular expression about where the problem was discovered. See perlre.

[Wed Dec 5 09:01:01 2012] mailnotify: (?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:))))))))))+ matches null string many times in regex; marked by <-- HERE in m/^\s+\*\s(?^l:(?:Main\.)?)((?^::upper:+:digit:+:upper:+:digit:*))\s+\-\s+((?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:(?^:))))))))))+ <-- HERE )\s*$/ at /var/www/twiki/lib/TWiki/Contrib/MailerContrib/WebNotify.pm line 360.


Thanks

-- LeoList - 2012-12-04

Leo, I re-read the code, and I added manually a (?^:(?^:xxxxx)) to a regex type value in LocalSite.cfg. It all looks kosher, e.g. the extra (?^:(?^:)) gets removed and only xxxxx remains. Can you verify that the patch is applied properly? Specifically code cleanup should be in 3 locations:

Try also to manually cleanup the regexes in LocalSite.cfg.

-- PeterThoeny - 2012-12-05

Have applied the above patches and can confirm that the warnings have disappeared and this now works as expected.

Thanks,

Leo

-- LeoList - 2012-12-06

I am glad it worked out. Marking TWikibug:Item7067 as done.

-- PeterThoeny - 2012-12-06

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title infinite loop pattern in Webnotify
SupportCategory CategoryEmail
TWiki version 5.1.2
Server OS Linux 2.6.42-26-generic (x86_64-linux-gnu-thread-multi)
Web server Apache/2.2.22 (Ubuntu)
Perl version 5.014002 (linux)
Browser & version Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2012-12-06 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.