Unable to run check class org.sonar.java.checks.regex.RegexStackOverflowCheck

Hi to everyone,

  • SonarQube version: 8.7.1
  • Java version: 11
  • Maven compiler plugin: 3.8.0

While running sonar scanner after successful build of our Java EE jar application, we am getting several of those check error.

build	18-Jun-2021 15:56:53	[ERROR] Unable to run check class org.sonar.java.checks.regex.RegexStackOverflowCheck - S5998 on file 'src/main/java/country/companyname/projectname/auth/BasicRegistrationAuthenticator.java', To help improve the SonarSource Java Analyzer, please report this problem to SonarSource: see https://community.sonarsource.com/
build	18-Jun-2021 15:56:53	java.lang.IllegalStateException: Lookaround should have been skipped
build	18-Jun-2021 15:56:53		at org.sonar.java.checks.regex.RegexStackOverflowCheck$StackOverflowFinder.edgeCost(RegexStackOverflowCheck.java:199)
build	18-Jun-2021 15:56:53		at org.sonar.java.checks.regex.RegexStackOverflowCheck$StackOverflowFinder.worstPath(RegexStackOverflowCheck.java:185)
build	18-Jun-2021 15:56:53		at org.sonar.java.checks.regex.RegexStackOverflowCheck$StackOverflowFinder.worstPath(RegexStackOverflowCheck.java:182)
build	18-Jun-2021 15:56:53		at org.sonar.java.checks.regex.RegexStackOverflowCheck$StackOverflowFinder.worstPath(RegexStackOverflowCheck.java:185)
build	18-Jun-2021 15:56:53		at org.sonar.java.checks.regex.RegexStackOverflowCheck$StackOverflowFinder.stackConsumption(RegexStackOverflowCheck.java:161)
build	18-Jun-2021 15:56:53		at org.sonar.java.checks.regex.RegexStackOverflowCheck$StackOverflowFinder.visitRepetition(RegexStackOverflowCheck.java:103)
build	18-Jun-2021 15:56:53		at org.sonar.java.regex.ast.RepetitionTree.accept(RepetitionTree.java:49)
build	18-Jun-2021 15:56:53		at org.sonar.java.regex.ast.RegexBaseVisitor.visit(RegexBaseVisitor.java:28)
build	18-Jun-2021 15:56:53		at org.sonar.java.regex.ast.RegexBaseVisitor.visitLookAround(RegexBaseVisitor.java:113)
build	18-Jun-2021 15:56:53		at org.sonar.java.regex.ast.LookAroundTree.accept(LookAroundTree.java:63)
build	18-Jun-2021 15:56:53		at org.sonar.java.regex.ast.RegexBaseVisitor.visit(RegexBaseVisitor.java:28)
build	18-Jun-2021 15:56:53		at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
build	18-Jun-2021 15:56:53		at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1083)
build	18-Jun-2021 15:56:53		at org.sonar.java.regex.ast.RegexBaseVisitor.visit(RegexBaseVisitor.java:36)
build	18-Jun-2021 15:56:53		at org.sonar.java.regex.ast.RegexBaseVisitor.visitSequence(RegexBaseVisitor.java:85)
build	18-Jun-2021 15:56:53		at org.sonar.java.regex.ast.SequenceTree.accept(SequenceTree.java:44)
build	18-Jun-2021 15:56:53		at org.sonar.java.regex.ast.RegexBaseVisitor.visit(RegexBaseVisitor.java:28)
build	18-Jun-2021 15:56:53		at org.sonar.java.regex.ast.RegexBaseVisitor.visit(RegexBaseVisitor.java:47)
build	18-Jun-2021 15:56:53		at org.sonar.java.checks.regex.RegexStackOverflowCheck.checkRegex(RegexStackOverflowCheck.java:66)
build	18-Jun-2021 15:56:53		at org.sonar.java.checks.regex.AbstractRegexCheck.lambda$onMethodInvocationFound$1(AbstractRegexCheck.java:152)
build	18-Jun-2021 15:56:53		at java.base/java.util.Optional.ifPresent(Optional.java:183)
build	18-Jun-2021 15:56:53		at org.sonar.java.checks.regex.AbstractRegexCheck.onMethodInvocationFound(AbstractRegexCheck.java:152)
build	18-Jun-2021 15:56:53		at org.sonar.java.checks.regex.AbstractRegexCheck.visitNode(AbstractRegexCheck.java:140)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.lambda$visit$6(VisitorsBridge.java:289)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.lambda$forEach$9(VisitorsBridge.java:304)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:168)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge.access$100(VisitorsBridge.java:63)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.forEach(VisitorsBridge.java:304)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit(VisitorsBridge.java:291)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren(VisitorsBridge.java:275)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit(VisitorsBridge.java:295)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren(VisitorsBridge.java:275)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit(VisitorsBridge.java:295)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren(VisitorsBridge.java:275)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit(VisitorsBridge.java:295)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.run(VisitorsBridge.java:266)
build	18-Jun-2021 15:56:53		at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:150)
build	18-Jun-2021 15:56:53		at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:123)
build	18-Jun-2021 15:56:53		at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:77)
build	18-Jun-2021 15:56:53		at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:115)
build	18-Jun-2021 15:56:53		at org.sonar.java.JavaSquid.scan(JavaSquid.java:108)
build	18-Jun-2021 15:56:53		at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:96)
build	18-Jun-2021 15:56:53		at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
build	18-Jun-2021 15:56:53		at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
build	18-Jun-2021 15:56:53		at 

Please is there any help to solve this error ?

Hi @patrickhub,

Thank you for the report. Could you please post the contents of BasicRegistrationAuthenticator.java or at least a list of the regular expressions used in that file? This would help us greatly in identifying the source of this bug and fixing it.

Thank you,
Sebastian

Hey Sebastian,

Thanks for your reply.

Please find attached the BasicAuthenticator.java file.

Best regard,

Advertisment_IntelligentVentilationNewsletter_e2c1565f-1e2c-45b8-af07-a48dc1e82f4b.png

(Attachment BasicRegistrationAuthenticator.java is missing)

Hi @patrickhub,

Thank you for your response, but your attachment did not show up. Please upload the file using the upload function of the forum or just copy-and-paste it into your post, instead of sending it as an email attachment. If the contents of the file shouldn’t be public, you can also send it to me as a personal message.

Thanks,
Sebastian

Hi Sebastian,

Thank for your reply.

I try to send you the content of code via a message but I couldn’t.

Please could you send me an email so that I can reply and directly send the code to you as email as it is private?

Thanks.

Hi Patrick,

Thanks for sending your code. It turns out this crash was already fixed as a consequence of another bug that we fixed in March. So upgrading SonarQube to the latest version (or the LTS) should get rid of the problem.

Cheers,
Sebastian

Hi Sebastian,

Thanks a lot. I will our SonarQube to the latest version and I will let you known.

Best regards

For questions and information regarding COVID-19 please visit our website: www.hamilton-medical.com/COVID-19

Patrick Deslé Djomo

Software Engineer

Hamilton Medical AG
Via Crusch 8
7402 Bonaduz
Switzerland

Phone: +41 58 610 28 54

Fax:

+41 58 610 00 20

Mail:

pdjomo@hamilton-medical.com

Web:

www.hamilton-medical.com

This message is confidential. It may also be privileged or otherwise protected by work product immunity or other legal rules. If you have received it by mistake, please let us know by e-mail reply and delete it from your system; you may not copy this message or disclose its contents to anyone. The integrity and security of this message cannot be guaranteed on the Internet.

Advertisment_IntelligentVentilationNewsletter_e2c1565f-1e2c-45b8-af07-a48dc1e82f4b.png

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.