This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 223923 - StackOverflowError at org.netbeans.modules.search.matcher.BufferedCharSequence$Sink$Buffer.access$1000
Summary: StackOverflowError at org.netbeans.modules.search.matcher.BufferedCharSequenc...
Status: RESOLVED WONTFIX
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-17 12:17 UTC by Exceptions Reporter
Modified: 2012-12-17 14:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 145145


Attachments
stacktrace (64.54 KB, text/plain)
2012-12-17 12:17 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2012-12-17 12:17:52 UTC
This bug was originally marked as duplicate of bug 154894, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.2 (Build 201207171143)
VM: Java HotSpot(TM) Client VM, 20.8-b03, Java(TM) SE Runtime Environment, 1.6.0_33-b05
OS: Windows 7

User Comments:
GUEST: Searching in all projects with regular expression: count(\n|.)*order

GUEST: Searching all projects with regular expression: count(\n|.)*order

GUEST: alterando propriedades do projeto, bibliotecas

GUEST: Testing this regex on find: "for(\n|.)*"




Stacktrace: 
java.lang.StackOverflowError
   at org.netbeans.modules.search.matcher.BufferedCharSequence$Sink$Buffer.access$1000(BufferedCharSequence.java:712)
   at org.netbeans.modules.search.matcher.BufferedCharSequence$Sink.charAt(BufferedCharSequence.java:662)
   at org.netbeans.modules.search.matcher.BufferedCharSequence.getCharAt(BufferedCharSequence.java:443)
   at org.netbeans.modules.search.matcher.BufferedCharSequence.charAt(BufferedCharSequence.java:297)
   at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3366)
   at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
Comment 1 Exceptions Reporter 2012-12-17 12:17:54 UTC
Created attachment 129452 [details]
stacktrace
Comment 2 Jaroslav Havlin 2012-12-17 14:05:56 UTC
The StackOverflowError is caused by regexp matcher, which probably tries to find occurrences of the pattern in a very long string.
I think that catching this exception is quite risky and it's better 
to display it.

As a workaround, try using reluctant quantifiers, e.g. count(\n|.)*?order.

You can also try to increase java stack size (in netbeans.conf change -J-Xss2m to -J-Xss4m, for example).

Thanks for understanding.