This is an automated email from the ASF dual-hosted git repository.

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 8d565ba5f708910865996ccd3d06e2b5c476b64e
Author: Riza Suminto <riza.sumi...@cloudera.com>
AuthorDate: Tue Jun 10 16:05:14 2025 -0700

    IMPALA-13649: Fix stack overflow in TestExprDepthLimit with JDK17
    
    TestExprDepthLimit hit stack overflow when composing expression tree 10x
    deeper than Expr.EXPR_DEPTH_LIMIT (1000). The test choose 10x for
    negative test where expression tree is too deep. This patch lower the
    multiple to 8x so that the expression tree does not hit stack overflow
    during creation.
    
    Testing:
    Pass FE_TEST with JDK17.
    
    Change-Id: Ibbe31598600da4b7f1510542ff9f32c8e8e1f9ad
    Reviewed-on: http://gerrit.cloudera.org:8080/23008
    Reviewed-by: Csaba Ringhofer <csringho...@cloudera.com>
    Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
---
 fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java 
b/fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java
index 5c11f4b38..bb77dcc7e 100644
--- a/fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java
+++ b/fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java
@@ -3055,8 +3055,8 @@ public class AnalyzeExprsTest extends AnalyzerTest {
         String.format("Exceeded the maximum depth of an expression tree (%s).",
         Expr.EXPR_DEPTH_LIMIT));
 
-    // Test 10x the safe depth (already at 1x, append 9x).
-    for (int i = 0; i < Expr.EXPR_DEPTH_LIMIT * 9; ++i) {
+    // Test 8x the safe depth (already at 1x, append 7x).
+    for (int i = 0; i < Expr.EXPR_DEPTH_LIMIT * 7; ++i) {
       exprStr.append(repeatSuffix);
     }
     AnalysisError(exprStr.toString(),
@@ -3076,9 +3076,9 @@ public class AnalyzeExprsTest extends AnalyzerTest {
         Expr.EXPR_DEPTH_LIMIT + 1),
         String.format("Exceeded the maximum depth of an expression tree (%s).",
         Expr.EXPR_DEPTH_LIMIT));
-    // Test 10x the safe depth.
+    // Test 8x the safe depth.
     AnalysisError("select " + getNestedFuncExpr(openFunc, baseArg, closeFunc,
-        Expr.EXPR_DEPTH_LIMIT * 10),
+        Expr.EXPR_DEPTH_LIMIT * 8),
         String.format("Exceeded the maximum depth of an expression tree (%s).",
         Expr.EXPR_DEPTH_LIMIT));
   }

Reply via email to