Uploaded image for project: 'SonarPHP'
  1. SonarPHP
  2. SONARPHP-1033

StackOverflow in S1764 IdenticalOperandsInBinaryExpressionCheck

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.10
    • Component/s: None
    • Labels:

      Description

      Reported in community: https://community.sonarsource.com/t/failing-analysis-id-4e3723d5-be06-4a58-a0c2-708f18ff07bd/30593

      Log:

          2020-09-04 02:59:03.407 java.lang.StackOverflowError
          2020-09-04 02:59:03.408 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:43)
          2020-09-04 02:59:03.408 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.408 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)
          2020-09-04 02:59:03.408 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.visitBinaryExpression(PHPVisitorCheck.java:382)
          2020-09-04 02:59:03.408 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:46)
          2020-09-04 02:59:03.408 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.408 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)
          2020-09-04 02:59:03.408 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.visitBinaryExpression(PHPVisitorCheck.java:382)
          2020-09-04 02:59:03.409 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:46)
          2020-09-04 02:59:03.409 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.409 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)
          2020-09-04 02:59:03.409 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.visitBinaryExpression(PHPVisitorCheck.java:382)
          2020-09-04 02:59:03.409 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:46)
          2020-09-04 02:59:03.409 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.409 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)
          2020-09-04 02:59:03.409 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.visitBinaryExpression(PHPVisitorCheck.java:382)
          2020-09-04 02:59:03.410 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:46)
          2020-09-04 02:59:03.410 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.410 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)
          2020-09-04 02:59:03.410 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.visitBinaryExpression(PHPVisitorCheck.java:382)
          2020-09-04 02:59:03.410 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:46)
          2020-09-04 02:59:03.410 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.410 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)
          2020-09-04 02:59:03.410 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.visitBinaryExpression(PHPVisitorCheck.java:382)
          2020-09-04 02:59:03.411 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:46)
          2020-09-04 02:59:03.411 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.411 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)
          2020-09-04 02:59:03.411 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.visitBinaryExpression(PHPVisitorCheck.java:382)
          2020-09-04 02:59:03.411 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:46)
          2020-09-04 02:59:03.411 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.411 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)
          2020-09-04 02:59:03.411 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.visitBinaryExpression(PHPVisitorCheck.java:382)
          2020-09-04 02:59:03.412 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:46)
          2020-09-04 02:59:03.412 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.412 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)
          2020-09-04 02:59:03.412 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.visitBinaryExpression(PHPVisitorCheck.java:382)
          2020-09-04 02:59:03.412 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:46)
          2020-09-04 02:59:03.412 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.412 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)
          2020-09-04 02:59:03.412 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.visitBinaryExpression(PHPVisitorCheck.java:382)
          2020-09-04 02:59:03.412 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:46)
          2020-09-04 02:59:03.413 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.413 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)
          2020-09-04 02:59:03.413 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.visitBinaryExpression(PHPVisitorCheck.java:382)
          2020-09-04 02:59:03.413 	at org.sonar.php.checks.IdenticalOperandsInBinaryExpressionCheck.visitBinaryExpression(IdenticalOperandsInBinaryExpressionCheck.java:46)
          2020-09-04 02:59:03.414 	at org.sonar.php.tree.impl.expression.BinaryExpressionTreeImpl.accept(BinaryExpressionTreeImpl.java:75)
          2020-09-04 02:59:03.417 	at org.sonar.plugins.php.api.visitors.PHPVisitorCheck.scan(PHPVisitorCheck.java:567)

       

      This seems to occur on deeply nested binary expressions. See reproducer attachement.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                karim.ouerghemmi Karim El Ouerghemmi
                Reporter:
                karim.ouerghemmi Karim El Ouerghemmi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: