question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] PatternSyntaxException: Stack overflow during pattern compilation near index 2

See original GitHub issue

Describe the bug (*)

A clear and concise description of what the bug is.

java.util.regex.PatternSyntaxException: Stack overflow during pattern compilation near index 2
(([A-Z][a-zA-Z0-9]+)_([A-Z][a-zA-Z0-9]+))
  ^
	at java.base/java.util.regex.Pattern.error(Pattern.java:2027)
	at java.base/java.util.regex.Pattern.<init>(Pattern.java:1430)
	at java.base/java.util.regex.Pattern.compile(Pattern.java:1068)
	at com.magento.idea.magento2plugin.reference.provider.util.GetModuleNameUtil.execute(GetModuleNameUtil.java:24)
	at com.magento.idea.magento2plugin.reference.provider.util.GetFilePathUtil.execute(GetFilePathUtil.java:24)
	at com.magento.idea.magento2plugin.reference.provider.FilePathReferenceProvider.getFiles(FilePathReferenceProvider.java:110)
	at com.magento.idea.magento2plugin.reference.provider.FilePathReferenceProvider.getReferencesByElement(FilePathReferenceProvider.java:38)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:199)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:162)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:141)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:39)
	at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
	at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:39)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
	at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
	at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:230)
	at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:28)
	at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:72)
	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:121)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:38)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:31)
	at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.createRefs(JSLiteralExpressionImpl.java:103)
	at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.lambda$static$0(JSLiteralExpressionImpl.java:78)
	at com.intellij.psi.impl.PsiParameterizedCachedValue.doCompute(PsiParameterizedCachedValue.java:46)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
	at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
	at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:230)
	at com.intellij.psi.impl.PsiParameterizedCachedValue.getValue(PsiParameterizedCachedValue.java:35)
	at com.intellij.psi.util.CachedValuesManager.getParameterizedCachedValue(CachedValuesManager.java:82)
	at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.getReferences(JSLiteralExpressionImpl.java:88)
	at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.getReference(JSLiteralExpressionImpl.java:83)
	at com.intellij.react.css.modules.psi.CssModulesUtil.getCssClassNamesImportOrRequireDeclaration(CssModulesUtil.java:171)
	at com.intellij.react.css.modules.psi.CssModulesIndexedStylesVarPsiReferenceContributor$1.getReferencesByElement(CssModulesIndexedStylesVarPsiReferenceContributor.java:33)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:199)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:162)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:141)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:39)
	at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
	at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:39)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
	at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
	at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:230)
	at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:28)
	at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:72)
	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:121)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:38)
	at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:31)
	at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.createRefs(JSLiteralExpressionImpl.java:103)
	at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.lambda$static$0(JSLiteralExpressionImpl.java:78)
	at com.intellij.psi.impl.PsiParameterizedCachedValue.doCompute(PsiParameterizedCachedValue.java:46)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
	at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
	at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:230)
	at com.intellij.psi.impl.PsiParameterizedCachedValue.getValue(PsiParameterizedCach

To Reproduce (*)

Steps to reproduce the behavior:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error

Expected behavior (*)

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Please complete the following information: (*)

  • OS: Mac OS X 12.0.1
  • PhpStorm/Intellij version: 2021.2.3
  • Plugin Version: 4.1.0

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Iamwadecommented, Jan 21, 2022

Hi @lukpeta I can’t seem to get the error to reproduce. Can you please describe pains and detailed steps for this

0reactions
bohdan-harniukcommented, Feb 1, 2022

Hello, @lukpeta!

I am closing this issue. Update your plugin to the latest available version. Please, reopen it or create new one if you will faced this problem again. Also, please, add steps to reproduce to it if it appears.

Regards,

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - What is wrong with : Pattern pattern = Pattern.compile("\\")
PatternSyntaxException: Unexpected internal error near index 1 \ ) ... the regex in a Java String you must double the slashes again.
Read more >
Crafting regexes to avoid stack overflows - SonarSource Blog
We've been working recently on adding rules to help write better regular expressions in Java. I've talked already about rules to find errors ......
Read more >
java regular expression giving stack overflow - CodeRanch
I'm having a very difficult time trying to get this regular expression in java to work. I just don't understand why it is...
Read more >
stack overflow in regex matching quantified alternation
Type: Bug. Status: Open ... I ran into this StackOverflowError while developing ... Pattern$BmpCharProperty.match(Pattern.java:3966)
Read more >
92e33d7e684469ef294d5517e6...
Pattern.compile(Pattern.java:374) After: Caused by: java.util.regex.PatternSyntaxException: Missing closing bracket in character class near index 6: hello[ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found