YaCy-Bugtracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000186YaCy[All Projects] Generalpublic2012-05-09 02:532012-05-18 22:20
Reporterespishak 
Assigned ToOrbiter 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
ETAnone 
PlatformMacOSOS XOS Version10.6.8
Product VersionYaCy 1.0 
Target VersionFixed in Version 
Summary0000186: PatternSyntaxException Crash from Unvalidated Regular Expression Usage
DescriptionYaCy sometimes crashes with an unhelpful stack trace. Setting the httpc.nameCacheNoCachingPatterns property to an invalid regular expression causes YaCy to throw a PatternSyntaxException and not to start. The PatternSyntaxException is not useful to users in diagnosing the error. I think it would be better to report a detailed error message. The attached patch makes this change.
Steps To Reproduce1. Set "httpc.nameCacheNoCachingPatterns" property in DATA/SETTINGS/yacy.conf to be "(" (without the quotes)
2. Start YaCy from the command line
3. YaCy fails to start
4. See exception in console output:

E 2012/05/08 00:29:15 STARTUP YaCy cannot start: Unclosed group near index 1
(
 ^
java.util.regex.PatternSyntaxException: Unclosed group near index 1
(
 ^
       at java.util.regex.Pattern.error(Pattern.java:1713)
       at java.util.regex.Pattern.accept(Pattern.java:1571)
       at java.util.regex.Pattern.group0(Pattern.java:2533)
       at java.util.regex.Pattern.sequence(Pattern.java:1806)
       at java.util.regex.Pattern.expr(Pattern.java:1752)
       at java.util.regex.Pattern.compile(Pattern.java:1460)
       at java.util.regex.Pattern.<init>(Pattern.java:1133)
       at java.util.regex.Pattern.compile(Pattern.java:823)
       at net.yacy.cora.protocol.Domains.makePatterns(Domains.java:513)
       at net.yacy.cora.protocol.Domains.setNoCachingPatterns(Domains.java:506)
       at net.yacy.search.Switchboard.<init>(Switchboard.java:734)
       at net.yacy.yacy.startup(yacy.java:222)
       at net.yacy.yacy.main(yacy.java:1018)
Additional InformationAfter applying the provided patch, the console output is:

E 2012/05/08 00:35:35 Switchboard Invalid regular expression in httpc.nameCacheNoCachingPatterns property: Unclosed group near index 1
(
 ^
TagsNo tags attached.
Attached Filespatch file icon YACY-186.patch [^] (1,390 bytes) 2012-05-09 02:54 [Show Content]

- Relationships

-  Notes
(0000373)
Orbiter (manager)
2012-05-18 22:20

fixed in https://gitorious.org/yacy/rc1/commit/d320a31ae16ce54922132944547d8f0a8db3a9b5 [^]

- Issue History
Date Modified Username Field Change
2012-05-09 02:53 espishak New Issue
2012-05-09 02:54 espishak File Added: YACY-186.patch
2012-05-18 22:20 Orbiter Note Added: 0000373
2012-05-18 22:20 Orbiter Status new => resolved
2012-05-18 22:20 Orbiter Resolution open => fixed
2012-05-18 22:20 Orbiter Assigned To => Orbiter


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker