Foswiki on GitHub is open for business! Next release meeting: Monday September 15, 1300Z

Item1293: PurePerl SEARCH crashes on distributed topic

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Urgent Closed Engine    
found on trunk, confirmed to happen on release branch too. - rather urgent as on windows, PurePerl is often required frown

goto FormattedSearch

Extract some text from a topic using regular expression

Write this:

= Could not perform search. Error was: Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE Back to\:* FrequentlyAskedQuestions/ =

To get this:

Could not perform search. Error was: Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE Back to\:* FrequentlyAskedQuestions/ at /data/trunk/core/lib/Foswiki/Store/SearchAlgorithms/PurePerl.pm line 42, line 1. at /data/trunk/core/lib/Foswiki/Store/SearchAlgorithms/PurePerl.pm line 42 Foswiki::Store::SearchAlgorithms::PurePerl::__ANON__('%META:TOPICINFO{author="ProjectContributor" date="1231502400"...') called at /data/trunk/core/lib/Foswiki/Store/SearchAlgorithms/PurePerl.pm line 48 Foswiki::Store::SearchAlgorithms::PurePerl::search('*Back to\:* FrequentlyAskedQuestions', 'ARRAY(0xa08de50)', 'HASH(0x9e32228)', '/data/trunk/core/data/System/', undef) called at /data/trunk/core/lib/Foswiki/Store/VCHandler.pm line 330 Foswiki::Store::VCHandler::searchInWebContent('Foswiki::Store::RcsWrapHandler=HASH(0x9e322b8)', '*Back to\:* FrequentlyAskedQuestions', 'ARRAY(0xa08de50)', 'HASH(0x9e32228)') called at /data/trunk/core/lib/Foswiki/Store/VCStore.pm line 627 Foswiki::Store::VCStore::searchInWebContent('Foswiki::Store::RcsWrap=HASH(0x9378b68)', '*Back to\:* FrequentlyAskedQuestions', 'System', 'ARRAY(0xa08de50)', 'HASH(0x9e32228)') called at /data/trunk/core/lib/Foswiki/Meta.pm line 404 Foswiki::Meta::searchInText('Foswiki::Meta=HASH(0x9e42bf0)', '*Back to\:* FrequentlyAskedQuestions', 'ARRAY(0xa08de50)', 'HASH(0x9e32228)') called at /data/trunk/core/lib/Foswiki/Search.pm line 251 Foswiki::Search::_searchTopics('Foswiki::Search=HASH(0x9dd3bf0)', 'Foswiki::Meta=HASH(0x9e42bf0)', 'text', 'regex', 'HASH(0xa0abf80)', 'ARRAY(0xa0959e8)', 'AccessControl', 'AccessKeys', 'AdminDocumentationCategory', ...) called at /data/trunk/core/lib/Foswiki/Search.pm line 691 Foswiki::Search::searchWeb('Foswiki::Search=HASH(0x9dd3bf0)', 'inline', 1, 'search', '*Back to\:* FrequentlyAskedQuestions', 'basetopic', 'FormattedSearch', '_RAW', ' "*Back to\:* FrequentlyAskedQuestions" scope="text" type="re...', ...) called at /data/trunk/core/lib/Foswiki.pm line 3630 Foswiki::__ANON__() called at /usr/share/perl5/Error.pm line 416 eval {...} called at /usr/share/perl5/Error.pm line 408 Error::subs::try('CODE(0xa08d3f0)', 'HASH(0x9dd4470)') called at /data/trunk/core/lib/Foswiki.pm line 3639 Foswiki::SEARCH('Foswiki=HASH(0x8f109b0)', 'Foswiki::Attrs=HASH(0xa08d4e0)', 'Foswiki::Meta=HASH(0x9db0740)') called at /data/trunk/core/lib/Foswiki.pm line 2621 Foswiki::_expandMacroOnTopicRendering('Foswiki=HASH(0x8f109b0)', 'SEARCH', ' "*Back to\:* FrequentlyAskedQuestions" scope="text" type="re...', 'Foswiki::Meta=HASH(0x9db0740)') called at /data/trunk/core/lib/Foswiki.pm line 2530 Foswiki::_processMacros('Foswiki=HASH(0x8f109b0)', '%STARTINCLUDE%\x{a}---+ Formatted Search\x{a}\x{a}_Inline search feature ...', 'CODE(0x924b028)', 'Foswiki::Meta=HASH(0x9db0740)', 16) called at /data/trunk/core/lib/Foswiki.pm line 2449 Foswiki::innerExpandMacros('Foswiki=HASH(0x8f109b0)', 'SCALAR(0x924b918)', 'Foswiki::Meta=HASH(0x9db0740)') called at /data/trunk/core/lib/Foswiki.pm line 2803 Foswiki::expandMacros('Foswiki=HASH(0x8f109b0)', '%STARTINCLUDE%\x{a}---+ Formatted Search\x{a}\x{a}_Inline search feature ...', 'Foswiki::Meta=HASH(0x9db0740)') called at /data/trunk/core/lib/Foswiki/Meta.pm line 1975 Foswiki::Meta::expandMacros('Foswiki::Meta=HASH(0x9db0740)', '%STARTINCLUDE%\x{a}---+ Formatted Search\x{a}\x{a}_Inline search feature ...') called at /data/trunk/core/lib/Foswiki/UI/View.pm line 391 Foswiki::UI::View::_prepare('%STARTINCLUDE%\x{a}---+ Formatted Search\x{a}\x{a}_Inline search feature ...', 'Foswiki::Meta=HASH(0x9db0740)', 0) called at /data/trunk/core/lib/Foswiki/UI/View.pm line 371 Foswiki::UI::View::view('Foswiki=HASH(0x8f109b0)') called at /data/trunk/core/lib/Foswiki/UI.pm line 183 Foswiki::UI::__ANON__() called at /usr/share/perl5/Error.pm line 416 eval {...} called at /usr/share/perl5/Error.pm line 408 Error::subs::try('CODE(0x9075828)', 'HASH(0x9daee10)') called at /data/trunk/core/lib/Foswiki/UI.pm line 252 Foswiki::UI::execute('Foswiki::Request=HASH(0x92c9280)', 'CODE(0x92c6a88)', 'view', 1) called at /data/trunk/core/lib/Foswiki/UI.pm line 121 Foswiki::UI::handleRequest('Foswiki::Request=HASH(0x92c9280)') called at /data/trunk/core/lib/Foswiki/Engine/CGI.pm line 26 Foswiki::Engine::CGI::run('Foswiki::Engine::CGI=HASH(0x91dfe28)') called 

Interestingly, on foswiki 1.0.0, you get the 'other' error that Olivier worked so much on...

Extract some text from a topic using regular expression

Write this:

%SEARCH{ "*Back to\:* FrequentlyAskedQuestions" scope="text" type="regex" nosearch="on" nototal="on" header="FAQs:" format="   * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [[$topic][Answer...]]" }%

To get this:

Could not perform search. Error was: Undefined subroutine &main:: called at C:/Program Files/Foswiki/Foswiki/lib/Foswiki/Store/SearchAlgorithms/PurePerl.pm line 44, line 1. 

The error is perfectly correct; that search contains an illegal regex. The regex should have been rejected by grep as well, but it isn't for whatever reason.

Corrected the topic.

-- CrawfordCurrie - 15 Mar 2009

ItemTemplate edit

Summary PurePerl SEARCH crashes on distributed topic
ReportedBy SvenDowideit
Codebase 1.0.3, trunk
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins Foswikirev:3112 Foswikirev:3113
TargetRelease patch
ReleasedIn 1.0.4
Topic revision: r5 - 19 Mar 2009, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License