Bug #49776 MEM Stack Overflow error due to a regexp bug in JDK
Submitted: 17 Dec 2009 18:34
Reporter: Chris Calender Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Enterprise Monitor: Server Severity:S3 (Non-critical)
Version:2.1.0.1096 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: java.lang.StackOverflowError, java.util.regex.Pattern$Branch.match, Stack Overflow

[17 Dec 2009 18:34] Chris Calender
Description:
Receiving the following Stack Overflow error which appears to be due to a known bug in 

Dec 17, 2009 9:54:10 AM org.apache.catalina.core.StandardWrapperValve invoke
INFO: java.lang.StackOverflowError
	at java.util.regex.Pattern$Branch.match(Unknown Source)
	at java.util.regex.Pattern$GroupHead.match(Unknown Source)
	at java.util.regex.Pattern$Loop.match(Unknown Source)
	at java.util.regex.Pattern$GroupTail.match(Unknown Source)
	at java.util.regex.Pattern$BranchConn.match(Unknown Source)
	at java.util.regex.Pattern$CharProperty.match(Unknown Source)

Last 6 lines repeat over and over.

I've attached the full stack trace to this bug report.

Note that this matches the output in the following bug for java:classes_util_regex:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507

This is also described in the following post as well:

http://blog.headius.com/2006/09/java-regex-broken-for-alternation-over.html

How to repeat:
N/A

Suggested fix:
Perhaps include the work-around mentioned in:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507

Which is:

Work-around:

Use "^([0-9a-fA-F])+$" 
or "^((?i)[0-9a-f])+$" 
or even "^([a-fA-F]|\\d)++$"
[17 Dec 2009 18:35] Chris Calender
Stack Overflow Error - full stack trace

Attachment: StackOverflowError.txt (text/plain), 64.19 KiB.

[25 Jun 2010 17:17] Enterprise Tools JIRA Robot
Andy Bang writes: 
We believe this was resolved in our 2.2 release by increasing the Java stack size.  In particular, in 2.1 we had:

  JAVA_OPTS="-Xmx768M -Xms768M -Xss128k ...

but in 2.2 we have:

  JAVA_OPTS="-Xmx768M -Xms768M ...

Note that we removed -Xss128k.

Can you please remove -Xss128k from setenv.sh in your existing 2.1 installation and re-test?  That file is in  <install-dir>/apache-tomcat/bin.  Note that if your Service Manager is running on Windows, the setting is "--JvmSs 128", and is in setenv.bat.

After removing that setting, you'll have to restart the Monitor services (and on Windows you'll have to reinstall them as well, which is fairly easy).  See "E.7. Configuring Tomcat Parameters" in the MySQL Enterprise Monitor 2.1 Manual for details:

https://enterprise.mysql.com/docs/monitor/2.1/en/mem-reference.html#mem-deployment-config-...