Bug 694790 - [apache] A rare StackOverflowError when parsing complex directives
Summary: [apache] A rare StackOverflowError when parsing complex directives
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
low
high
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-08 12:55 UTC by Lukas Krejci
Modified: 2022-03-31 04:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Lukas Krejci 2011-04-08 12:55:39 UTC
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


Note You need to log in before you can comment on or make changes to this bug.