Bug 694790

Summary: [apache] A rare StackOverflowError when parsing complex directives
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
Component: PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: low    
Version: 4.0.0CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Lukas Krejci 2011-04-08 08:55:39 EDT
Description of problem:

Due to bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6337993 in Java regular expressions implementation we suffer from the stack overflow errors when parsing "long" directives.

An example could be some conditional rules for logging like (an artifical example, in reality each of the below IPs would be different):

SetEnvIf Remote_Addr "(111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111)" specialrequests
CustomLog logs/access_log common env=!specialrequests

How reproducible:
always

Steps to Reproduce:
1. Modify httpd.conf and add a long directive similar to the one above
2. run discovery on the agent
  
Actual results:
stack overflow error during apache server discovery

Expected results:
no exceptions, config files parsed successfully

Additional info:

Workaround is to increase the stack size of the JVM:

RHQ_AGENT_ADDITIONAL_JAVA_OPTS='-Xss10M' bin/rhq-agent.sh