You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/24 19:51:34 UTC

[GitHub] [arrow-datafusion] NGA-TRAN opened a new issue #419: parquet::build_row_grpup_predicate hits stackoverflowed

NGA-TRAN opened a new issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419


   **Describe the bug**
   A clear and concise description of what the bug is.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   
   **Expected behavior**
   A clear and concise description of what you expected to happen.
   
   **Additional context**
   Add any other context about the problem here.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Igosuki commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
Igosuki commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-917623587


   Recursion reaches its limits here, and the nesting is only 3 levels deep


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-917623784


   I wonder if there is some massive structure being placed on the stack somewhere


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Igosuki commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
Igosuki commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-917626393


   This is starting to look like a problem with tokio's test harness ? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] NGA-TRAN commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
NGA-TRAN commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-920122656


   Thanks @Igosuki 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-925299169


   We are hitting this in IOx now more regularly so I plan to work on a real fix. Assigning to myself


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Igosuki commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
Igosuki commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-926243003


       --> 432944 bytes on stack haha wth 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb edited a comment on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
alamb edited a comment on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-926176783


   Some observations:
   *  each stack frame of BinaryExpr::evaluate takes up 500K
   * If we run the test in release mode there are no problems
   * If we run with a larger stack frame there are no problems
   * there are only a few frames of the offending function
   
   Thus my theory is that because there are so many locals created in `BinaryExpr::evaluate` (total, not in use any any one time), the debug build leaves a (unique) space for them all and thus each frame is bloated.
   
   I have prototyped fixing the stack error by splitting the `evaluate` function into several smaller ones (each with fewer variables and thus requiring less stack. I hope to have a PR up shortly.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] houqp closed issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
houqp closed issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-847337810


   Looks to me like perhaps there is some large intermediate temporary on the stack ?
   ```
   frame #1: 0x0000000100cd9f2e server-1e6859002d2827ad`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::hb8fed722869b3a1e at binary.rs:419
      409 	            &self.left.data_type(input_schema)?,
      410 	            &self.op,
      411 	            &self.right.data_type(input_schema)?,
      412 	        )
      413 	    }
      414 	
      415 	    fn nullable(&self, input_schema: &Schema) -> Result<bool> {
      416 	        Ok(self.left.nullable(input_schema)? || self.right.nullable(input_schema)?)
      417 	    }
      418 	
   -> 419 	    fn evaluate(&self, batch: &RecordBatch) -> Result<ColumnarValue> {
      420 	        let left_value = self.left.evaluate(batch)?;
      421 	        let right_value = self.right.evaluate(batch)?;
      422 	        let left_data_type = left_value.data_type();
      423 	        let right_data_type = right_value.data_type();
      424 	
      425 	        if left_data_type != right_data_type {
      426 	            return Err(DataFusionError::Internal(format!(
      427 	                "Cannot evaluate binary expression {:?} with types {:?} and {:?}",
      428 	                self.op, left_data_type, right_data_type
      429 	            )));
   (lldb) 
   frame #2: 0x0000000100cd9fd4 server-1e6859002d2827ad`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::hb8fed722869b3a1e at binary.rs:420:26
      410 	            &self.op,
      411 	            &self.right.data_type(input_schema)?,
      412 	        )
      413 	    }
      414 	
      415 	    fn nullable(&self, input_schema: &Schema) -> Result<bool> {
      416 	        Ok(self.left.nullable(input_schema)? || self.right.nullable(input_schema)?)
      417 	    }
      418 	
      419 	    fn evaluate(&self, batch: &RecordBatch) -> Result<ColumnarValue> {
   -> 420 	        let left_value = self.left.evaluate(batch)?;
      421 	        let right_value = self.right.evaluate(batch)?;
      422 	        let left_data_type = left_value.data_type();
      423 	        let right_data_type = right_value.data_type();
      424 	
      425 	        if left_data_type != right_data_type {
      426 	            return Err(DataFusionError::Internal(format!(
      427 	                "Cannot evaluate binary expression {:?} with types {:?} and {:?}",
      428 	                self.op, left_data_type, right_data_type
      429 	            )));
      430 	        }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-926124726


   I poked a bit at the stack frames in `lldb` and did some calculations to make sure I was going to optimize in the right place. It does indeed appear to be the case that calling `PhysicalExpr::evaluate` is consuming ~ 512 kilobytes (yes Kbytes!) per call. No wonder we exhaust the 2M stack size so quickly. Here are the first few frames annotated (frames are SP and then FP (aka the program counter)
   
   ```text
   * thread #2, name = 'tests::run_q12', stop reason = EXC_BAD_ACCESS (code=2, address=0x7000061b4e08)
     * , 0x00007000061b4e00 0x0000000102390cd7 tpch-d1dd42414dc4efc0`__rust_probestack + 23
       , 0x0000700006201e10 0x00000001003c21ce tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::he42f37d41cceceee at binary.rs:533
       --> 16 bytes on stack
       , 0x0000700006201e20 0x00000001003c2427 tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::he42f37d41cceceee at binary.rs:535:27
       --> 432944 bytes on stack
       , 0x000070000626b950 0x00000001003c22d5 tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::he42f37d41cceceee at binary.rs:534:26
       --> 432944 bytes on stack
       , 0x00007000062d5480 0x00000001003c22d5 tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::he42f37d41cceceee at binary.rs:534:26
       --> 432944 bytes on stack
       , 0x000070000633efb0 0x00000001003c22d5 tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::he42f37d41cceceee at binary.rs:534:26
       --> 432944 bytes on stack
       , 0x00007000063a8ae0 0x0000000100ce5d63 tpch-d1dd42414dc4efc0`datafusion::physical_plan::filter::batch_filter::h6d01affced9c33ab at filter.rs:171:5
       --> 384 bytes on stack
       , 0x00007000063a8c60 0x000000010079debc tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..filter..FilterExecStream$u20$as$u20$futures_core..stream..Stream$GT$::poll_next::_$u7b$$u7b$closure$u7d$$u7d$::h1e066b7ebe727810 at filter.rs:200:38
       --> 304 bytes on stack
       , 0x00007000063a8d90 0x000000010039e4eb tpch-d1dd42414dc4efc0`core::task::poll::Poll$LT$T$GT$::map::hcfcd71d24baa4ced at poll.rs:50:43
       --> 224 bytes on stack
       , 0x00007000063a8e70 0x0000000100ce5e48 tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..filter..FilterExecStream$u20$as$u20$futures_core..stream..Stream$GT$::poll_next::h7ad8b643987fa2d2 at filter.rs:197:20
       , 0x00007000063a8f50 0x00000001006d1b1c tpch-d1dd42414dc4efc0`_$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$futures_core..stream..Stream$GT$::poll_next::hc489fa3f376563a0 at stream.rs:120:9
       , 0x00007000063a8fa0 0x00000001006ce191 tpch-d1dd42414dc4efc0`futures_util::stream::stream::StreamExt::poll_next_unpin::hcc78f3c14df06bbc at mod.rs:1474:9
       , 0x00007000063a8fe0 0x000000010026024a tpch-d1dd42414dc4efc0`datafusion::physical_plan::coalesce_batches::CoalesceBatchesStream::poll_next_inner::h511be3325b3821cb at coalesce_batches.rs:199:31
       , 0x00007000063a95a0 0x000000010026003c tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..coalesce_batches..CoalesceBatchesStream$u20$as$u20$futures_core..stream..Stream$GT$::poll_next::h0e9007838b997173 at coalesce_batches.rs:175:20
       , 0x00007000063a9640 0x00000001006d1b1c tpch-d1dd42414dc4efc0`_$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$futures_core..stream..Stream$GT$::poll_next::hc489fa3f376563a0 at stream.rs:120:9
       , 0x00007000063a9690 0x00000001006d0444 tpch-d1dd42414dc4efc0`_$LT$S$u20$as$u20$futures_core..stream..TryStream$GT$::try_poll_next::h48212a61cdeb4f34 at stream.rs:196:9
       , 0x00007000063a96b0 0x0000000100bfbf07 tpch-d1dd42414dc4efc0`_$LT$futures_util..stream..try_stream..try_fold..TryFold$LT$St$C$Fut$C$T$C$F$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h7f86ea6de64bb954 at try_fold.rs:81:34
       , 0x00007000063a9c20 0x0000000100966157 tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..hash_join..HashJoinExec$u20$as$u20$datafusion..physical_plan..ExecutionPlan$GT$::execute::_$u7b$$u7b$closure$u7d$$u7d$::h14a374cbeedf00bc at hash_join.rs:287:55
       , 0x00007000063abbd0 0x000000010073427b tpch-d1dd42414dc4efc0`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h6d74d3b1595ffd58 at mod.rs:80:19
       , 0x00007000063abda0 0x00000001006d18cc tpch-d1dd42414dc4efc0`_$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h5fcab9b0ba2452d4 at future.rs:119:9
       , 0x00007000063abdf0 0x00000001002c9100 tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..coalesce_batches..CoalesceBatchesExec$u20$as$u20$datafusion..physical_plan..ExecutionPlan$GT$::execute::_$u7b$$u7b$closure$u7d$$u7d$::hdc8423bc7c22a335 at coalesce_batches.rs:116:20
       , 0x00007000063ac470 0x000000010073378b tpch-d1dd42414dc4efc0`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h49ed7ae8f3d60164 at mod.rs:80:19
       , 0x00007000063ac640 0x00000001006d18cc tpch-d1dd42414dc4efc0`_$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h5fcab9b0ba2452d4 at future.rs:119:9
       , 0x00007000063ac690 0x0000000100c87de5 tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..hash_aggregate..HashAggregateExec$u20$as$u20$datafusion..physical_plan..ExecutionPlan$GT$::execute::_$u7b$$u7b$closure$u7d$$u7d$::h07d84b4fae6d4e61 at hash_aggregate.rs:210:21
       , 0x00007000063acdc0 0x000000010073546b tpch-d1dd42414dc4efc0`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::haf148676daab2c25 at mod.rs:80:19
       , 0x00007000063acf90 0x00000001006d18cc tpch-d1dd42414dc4efc0`_$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h5fcab9b0ba2452d4 at future.rs:119:9
       , 0x00007000063acfe0 0x0000000100c87de5 tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..hash_aggregate..HashAggregateExec$u20$as$u20$datafusion..physical_plan..ExecutionPlan$GT$::execute::_$u7b$$u7b$closure$u7d$$u7d$::h07d84b4fae6d4e61 at hash_aggregate.rs:210:21
       , 0x00007000063ad710 0x000000010073546b tpch-d1dd42414dc4efc0`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::haf148676daab2c25 at mod.rs:80:19
       , 0x00007000063ad8e0 0x00000001006d18cc tpch-d1dd42414dc4efc0`_$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h5fcab9b0ba2452d4 at future.rs:119:9
       , 0x00007000063ad930 0x00000001005cd910 tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..projection..ProjectionExec$u20$as$u20$datafusion..physical_plan..ExecutionPlan$GT$::execute::_$u7b$$u7b$closure$u7d$$u7d$::h8abb8d907b0181c2 at projection.rs:137:20
       , 0x00007000063adf90 0x000000010073390b tpch-d1dd42414dc4efc0`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h575eb6d06073d6f2 at mod.rs:80:19
       , 0x00007000063ae160 0x00000001006d18cc tpch-d1dd42414dc4efc0`_$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h5fcab9b0ba2452d4 at future.rs:119:9
       , 0x00007000063ae1b0 0x0000000100d14586 tpch-d1dd42414dc4efc0`_$LT$datafusion..physical_plan..sort..SortExec$u20$as$u20$datafusion..physical_plan..ExecutionPlan$GT$::execute::_$u7b$$u7b$closure$u7d$$u7d$::hdb7d68bc620d3b3f at sort.rs:157:21
       , 0x00007000063ae9b0 0x000000010073438b tpch-d1dd42414dc4efc0`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h702af8754d369a19 at mod.rs:80:19
       , 0x00007000063aeb80 0x00000001006d18cc tpch-d1dd42414dc4efc0`_$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h5fcab9b0ba2452d4 at future.rs:119:9
       , 0x00007000063aebd0 0x0000000100741881 tpch-d1dd42414dc4efc0`datafusion::physical_plan::execute_stream::_$u7b$$u7b$closure$u7d$$u7d$::h9006f71ecf9d7c81 at mod.rs:324:14
       , 0x00007000063af010 0x0000000100733c3b tpch-d1dd42414dc4efc0`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h5d683efcc00cb9d5 at mod.rs:80:19
       , 0x00007000063af1e0 0x0000000100741037 tpch-d1dd42414dc4efc0`datafusion::physical_plan::collect::_$u7b$$u7b$closure$u7d$$u7d$::hb0414a00ed133045 at mod.rs:314:18
       , 0x00007000063af7c0 0x0000000100734cab tpch-d1dd42414dc4efc0`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h8cd3dded9aa5e964 at mod.rs:80:19
       , 0x00007000063af990 0x0000000100088614 tpch-d1dd42414dc4efc0`tpch::execute_query::_$u7b$$u7b$closure$u7d$$u7d$::h6a31f2bb36b5a98f at tpch.rs:358:18
       , 0x00007000063b08b0 0x00000001000118ab tpch-d1dd42414dc4efc0`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::hd90290e54a20817c at mod.rs:80:19
       , 0x00007000063b0a80 0x000000010000705e tpch-d1dd42414dc4efc0`tpch::tests::run_query::_$u7b$$u7b$closure$u7d$$u7d$::ha3e6b3a88f8a1169 at tpch.rs:989:9
       , 0x00007000063b1c60 0x0000000100010e0b tpch-d1dd42414dc4efc0`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h99e40fc288fdfd10 at mod.rs:80:19
       , 0x00007000063b1e20 0x000000010000d269 tpch-d1dd42414dc4efc0`tpch::tests::run_q12::_$u7b$$u7b$closure$u7d$$u7d$::h49b5a29960034e32 at tpch.rs:742:9
       , 0x00007000063b22e0 0x000000010000f04b tpch-d1dd42414dc4efc0`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h0189e8986b948636 at mod.rs:80:19
       , 0x00007000063b24a0 0x000000010008b6fe tpch-d1dd42414dc4efc0`_$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$core..future..future..Future$GT$::poll::hb4b1157f9d194816 at future.rs:119:9
       , 0x00007000063b24e0 0x0000000100059a91 tpch-d1dd42414dc4efc0`tokio::runtime::basic_scheduler::Inner$LT$P$GT$::block_on::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h0226903086e919ea at basic_scheduler.rs:218:62
       , 0x00007000063b2520 0x00000001000b031a tpch-d1dd42414dc4efc0`tokio::coop::with_budget::_$u7b$$u7b$closure$u7d$$u7d$::h8828a1c2d2d11cd0 at coop.rs:106:9
       , 0x00007000063b2590 0x0000000100023590 tpch-d1dd42414dc4efc0`std::thread::local::LocalKey$LT$T$GT$::try_with::ha7b22ebce65db54d at local.rs:399:16
       , 0x00007000063b2690 0x0000000100015ed0 tpch-d1dd42414dc4efc0`std::thread::local::LocalKey$LT$T$GT$::with::h8ab9af8d4028284a at local.rs:375:9
       , 0x00007000063b2740 0x0000000100059435 tpch-d1dd42414dc4efc0`tokio::runtime::basic_scheduler::Inner$LT$P$GT$::block_on::_$u7b$$u7b$closure$u7d$$u7d$::hfa569899022245b5 [inlined] tokio::coop::with_budget::hd79008321ef49337 at coop.rs:99:5
       , 0x00007000063b2740 0x000000010005940a tpch-d1dd42414dc4efc0`tokio::runtime::basic_scheduler::Inner$LT$P$GT$::block_on::_$u7b$$u7b$closure$u7d$$u7d$::hfa569899022245b5 [inlined] tokio::coop::budget::h11495e7774e41595 at coop.rs:76:5
       , 0x00007000063b2740 0x00000001000593c9 tpch-d1dd42414dc4efc0`tokio::runtime::basic_scheduler::Inner$LT$P$GT$::block_on::_$u7b$$u7b$closure$u7d$$u7d$::hfa569899022245b5 at basic_scheduler.rs:218:39
       , 0x00007000063b2a90 0x0000000100076278 tpch-d1dd42414dc4efc0`tokio::runtime::basic_scheduler::enter::_$u7b$$u7b$closure$u7d$$u7d$::hdfca83855dc6f190 at basic_scheduler.rs:317:29
       , 0x00007000063b2ac0 0x000000010003e226 tpch-d1dd42414dc4efc0`tokio::macros::scoped_tls::ScopedKey$LT$T$GT$::set::h5b3dafbe118a0361 at scoped_tls.rs:61:9
       , 0x00007000063b2b50 0x0000000100072789 tpch-d1dd42414dc4efc0`tokio::runtime::basic_scheduler::enter::h958ef531557473b4 at basic_scheduler.rs:317:5
       , 0x00007000063b2d00 0x000000010004208c tpch-d1dd42414dc4efc0`tokio::runtime::basic_scheduler::Inner$LT$P$GT$::block_on::h41c46b4e06a69514 at basic_scheduler.rs:206:9
       , 0x00007000063b2d20 0x000000010005da6c tpch-d1dd42414dc4efc0`tokio::runtime::basic_scheduler::InnerGuard$LT$P$GT$::block_on::h6a9c922407abcb70 at basic_scheduler.rs:467:9
       , 0x00007000063b2d80 0x000000010006616a tpch-d1dd42414dc4efc0`tokio::runtime::basic_scheduler::BasicScheduler$LT$P$GT$::block_on::hc89b31adf0383b74 at basic_scheduler.rs:166:24
       , 0x00007000063b3590 0x00000001000773ab tpch-d1dd42414dc4efc0`tokio::runtime::Runtime::block_on::h3bbb308a7585d4ed at mod.rs:457:46
       , 0x00007000063b3c10 0x000000010003af5c tpch-d1dd42414dc4efc0`tpch::tests::run_q12::h7ccf8261df5eafd3 at tpch.rs:742:9
       , 0x00007000063b48b0 0x000000010000d0f4 tpch-d1dd42414dc4efc0`tpch::tests::run_q12::_$u7b$$u7b$closure$u7d$$u7d$::hdd9a9441baa383ce at tpch.rs:741:11
       , 0x00007000063b4940 0x00000001000b5f71 tpch-d1dd42414dc4efc0`core::ops::function::FnOnce::call_once::he7e0a689a77a11af at function.rs:227:5
       , 0x00007000063b4970 0x00000001000ed9aa tpch-d1dd42414dc4efc0`test::__rust_begin_short_backtrace::h918af6527b4f3a5f [inlined] core::ops::function::FnOnce::call_once::hda3dde5198d7981d at function.rs:227:5
       , 0x00007000063b4970 0x00000001000ed9a8 tpch-d1dd42414dc4efc0`test::__rust_begin_short_backtrace::h918af6527b4f3a5f at lib.rs:578:5
       , 0x00007000063b4990 0x00000001000ec640 tpch-d1dd42414dc4efc0`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h76a4cff99fa950a4 [inlined] _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::h6b32404599e69da6 at boxed.rs:1572:9
       , 0x00007000063b4990 0x00000001000ec63a tpch-d1dd42414dc4efc0`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h76a4cff99fa950a4 [inlined] _$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::hcd1e3b3f21c877a2 at panic.rs:347:9
       , 0x00007000063b4990 0x00000001000ec63a tpch-d1dd42414dc4efc0`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h76a4cff99fa950a4 [inlined] std::panicking::try::do_call::hb927d691259a6685 at panicking.rs:401:40
       , 0x00007000063b4990 0x00000001000ec63a tpch-d1dd42414dc4efc0`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h76a4cff99fa950a4 [inlined] std::panicking::try::h9a6af709ddc92189 at panicking.rs:365:19
       , 0x00007000063b4990 0x00000001000ec63a tpch-d1dd42414dc4efc0`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h76a4cff99fa950a4 [inlined] std::panic::catch_unwind::h854b1ff2256a14ec at panic.rs:434:14
       , 0x00007000063b4990 0x00000001000ec63a tpch-d1dd42414dc4efc0`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h76a4cff99fa950a4 [inlined] test::run_test_in_process::h30275bf17498d01d at lib.rs:601:18
       , 0x00007000063b4990 0x00000001000ec620 tpch-d1dd42414dc4efc0`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h76a4cff99fa950a4 at lib.rs:493:39
       , 0x00007000063b4df0 0x00000001000baf7c tpch-d1dd42414dc4efc0`std::sys_common::backtrace::__rust_begin_short_backtrace::h7649c4fbea4fb790 [inlined] test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h5dd38d641a600688 at lib.rs:520:37
       , 0x00007000063b4df0 0x00000001000baeab tpch-d1dd42414dc4efc0`std::sys_common::backtrace::__rust_begin_short_backtrace::h7649c4fbea4fb790 at backtrace.rs:125:18
       , 0x00007000063b4f20 0x00000001000bf854 tpch-d1dd42414dc4efc0`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h84dcca60f7717f46 [inlined] std::thread::Builder::spawn_unchecked::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hbe895f9cdc1c7449 at mod.rs:476:17
       , 0x00007000063b4f20 0x00000001000bf84f tpch-d1dd42414dc4efc0`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h84dcca60f7717f46 [inlined] _$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h1418e3ae7800f523 at panic.rs:347:9
       , 0x00007000063b4f20 0x00000001000bf84f tpch-d1dd42414dc4efc0`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h84dcca60f7717f46 [inlined] std::panicking::try::do_call::he823a50421313ff3 at panicking.rs:401:40
       , 0x00007000063b4f20 0x00000001000bf84f tpch-d1dd42414dc4efc0`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h84dcca60f7717f46 [inlined] std::panicking::try::ha8593682dfaab37a at panicking.rs:365:19
       , 0x00007000063b4f20 0x00000001000bf84f tpch-d1dd42414dc4efc0`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h84dcca60f7717f46 [inlined] std::panic::catch_unwind::h27d29789bda74f3c at panic.rs:434:14
       , 0x00007000063b4f20 0x00000001000bf84f tpch-d1dd42414dc4efc0`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h84dcca60f7717f46 [inlined] std::thread::Builder::spawn_unchecked::_$u7b$$u7b$closure$u7d$$u7d$::he70733db09ba3760 at mod.rs:475:30
       , 0x00007000063b4f20 0x00000001000bf804 tpch-d1dd42414dc4efc0`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h84dcca60f7717f46 at function.rs:227:5
       , 0x00007000063b4f70 0x000000010236f20b tpch-d1dd42414dc4efc0`std::sys::unix::thread::Thread::new::thread_start::h0a9760ff4c2a0824 [inlined] _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::hede360aa47e22075 at boxed.rs:1572:9
       , 0x00007000063b4f70 0x000000010236f205 tpch-d1dd42414dc4efc0`std::sys::unix::thread::Thread::new::thread_start::h0a9760ff4c2a0824 [inlined] _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::h75d35c6fa9d8b805 at boxed.rs:1572:9
       , 0x00007000063b4f70 0x000000010236f1fc tpch-d1dd42414dc4efc0`std::sys::unix::thread::Thread::new::thread_start::h0a9760ff4c2a0824 at thread.rs:74:17
       , 0x00007000063b4fc0 0x00007fff204a38fc libsystem_pthread.dylib`_pthread_start + 224
       , 0x00007000063b4fe0 0x00007fff2049f443 libsystem_pthread.dylib`thread_start + 15
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
Dandandan commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-917632336


   Same question here as in https://github.com/apache/arrow-datafusion/pull/910 Does the error go away when running the tests in release mode?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
Dandandan commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-926683849


   Haha - great find @alamb 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Igosuki commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
Igosuki commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-920086701


   @NGA-TRAN see https://github.com/apache/arrow-datafusion/pull/910#issuecomment-919939740


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb edited a comment on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
alamb edited a comment on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-926613216


   Here is a simple reproducer showing the problem:
   
   ```diff
   diff --git a/datafusion/src/physical_plan/expressions/binary.rs b/datafusion/src/physical_plan/expressions/binary.rs
   index e77b25c40..560fb514a 100644
   --- a/datafusion/src/physical_plan/expressions/binary.rs
   +++ b/datafusion/src/physical_plan/expressions/binary.rs
   @@ -1381,4 +1381,36 @@ mod tests {
                ))
            }
        }
   +
   +    #[test]
   +    fn relatively_deeply_nested() {
   +        // Reproducer for https://github.com/apache/arrow-datafusion/issues/419
   +
   +        // where even relatively shallow binary expressions overflowed
   +        // the stack in debug builds
   +
   +        let input: Vec<_> = vec![1, 2, 3, 4, 5].into_iter().map(Some).collect();
   +        let a : Int32Array = input.iter().collect();
   +
   +        let batch = RecordBatch::try_from_iter(vec![("a", Arc::new(a) as _)]).unwrap();
   +        let schema = batch.schema();
   +
   +        // build a left deep tree ((((a + a) + a) + a ....
   +        let tree_depth: i32 = 10;
   +        let expr = (0..tree_depth)
   +            .into_iter()
   +            .map(|_| col("a", schema.as_ref()).unwrap())
   +            .reduce(|l, r| binary_simple(l, Operator::Plus, r))
   +            .unwrap();
   +
   +        println!("Evaluating expr {:?}", expr);
   +        let result = expr
   +            .evaluate(&batch)
   +            .expect("evaluation")
   +            .into_array(batch.num_rows());
   +
   +        let expected: Int32Array = input.into_iter().map(|i| i.map(|i| i * tree_depth)).collect();
   +        assert_eq!(result.as_ref(), &expected);
   +    }
   +
    }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] houqp commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
houqp commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-926294754


   This is nuts, good found @alamb haha


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-847336692


   Some more information: 
   
   The test in question is in https://github.com/influxdata/influxdb_iox/pull/1550
   
   When we run it the output is:
   ```
   
   thread 'IOx Executor Thread' has overflowed its stack
   fatal runtime error: stack overflow
   error: test failed, to rerun pass '-p server --lib'
   
   Caused by:
     process didn't exit successfully: `/Users/alamb/Software/influxdb_iox/target/debug/deps/server-1e6859002d2827ad predicate_pushdown` (signal: 6, SIGABRT: process abort signal)
   ```
   
   When I look in the debugger, here is the stack trace (it isn't obviously some deeply nested problem):
   
   ```
   (lldb) bt
   * thread #49, name = 'IOx Executor Thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x70000b29c6a8)
     * frame #0: 0x0000000102f2eb28 server-1e6859002d2827ad`__rust_probestack + 23
       frame #1: 0x0000000100cd9f2e server-1e6859002d2827ad`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::hb8fed722869b3a1e at binary.rs:419
       frame #2: 0x0000000100cd9fd4 server-1e6859002d2827ad`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::hb8fed722869b3a1e at binary.rs:420:26
       frame #3: 0x0000000100cd9fd4 server-1e6859002d2827ad`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::hb8fed722869b3a1e at binary.rs:420:26
       frame #4: 0x0000000100cd9fd4 server-1e6859002d2827ad`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::hb8fed722869b3a1e at binary.rs:420:26
       frame #5: 0x0000000100cd9fd4 server-1e6859002d2827ad`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::hb8fed722869b3a1e at binary.rs:420:26
       frame #6: 0x0000000100cd9fd4 server-1e6859002d2827ad`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::hb8fed722869b3a1e at binary.rs:420:26
       frame #7: 0x0000000100cd9fd4 server-1e6859002d2827ad`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::hb8fed722869b3a1e at binary.rs:420:26
       frame #8: 0x0000000100cd9fd4 server-1e6859002d2827ad`_$LT$datafusion..physical_plan..expressions..binary..BinaryExpr$u20$as$u20$datafusion..physical_plan..PhysicalExpr$GT$::evaluate::hb8fed722869b3a1e at binary.rs:420:26
       frame #9: 0x0000000100c40056 server-1e6859002d2827ad`datafusion::physical_optimizer::pruning::PruningPredicateBuilder::build_pruning_predicate::_$u7b$$u7b$closure$u7d$$u7d$::h1467784e69d7c9cd at pruning.rs:116:13
       frame #10: 0x0000000100d6b960 server-1e6859002d2827ad`core::result::Result$LT$T$C$E$GT$::and_then::h71aebb4468084708 at result.rs:704:22
       frame #11: 0x0000000100c3fd1a server-1e6859002d2827ad`datafusion::physical_optimizer::pruning::PruningPredicateBuilder::build_pruning_predicate::h61b2ce3b0cc7a21b at pruning.rs:109:31
       frame #12: 0x000000010086f79f server-1e6859002d2827ad`parquet_file::storage::Storage::read_file::h233ad543651c1195 at storage.rs:383:36
       frame #13: 0x000000010086eedc server-1e6859002d2827ad`parquet_file::storage::Storage::read_filter::h5f0de4fea5323c56 at storage.rs:334:25
       frame #14: 0x000000010084cf7e server-1e6859002d2827ad`parquet_file::table::Table::read_filter::h54c7e0710c497220 at table.rs:142:9
       frame #15: 0x0000000100848f7d server-1e6859002d2827ad`parquet_file::chunk::Chunk::read_filter::hf5996f304e09d139 at chunk.rs:155:9
       frame #16: 0x00000001004343ed server-1e6859002d2827ad`_$LT$server..db..chunk..DbChunk$u20$as$u20$query..PartitionChunk$GT$::read_filter::h780dcbe9c3fa8e68 at chunk.rs:317:49
       frame #17: 0x00000001005676ea server-1e6859002d2827ad`_$LT$query..provider..physical..IOxReadFilterNode$LT$C$GT$$u20$as$u20$datafusion..physical_plan..ExecutionPlan$GT$::execute::_$u7b$$u7b$closure$u7d$$u7d$::hef1801e72d44e68c at physical.rs:103:22
       frame #18: 0x0000000100047d2a server-1e6859002d2827ad`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::hd15f169c5873be32 at mod.rs:80:19
       frame #19: 0x0000000100ec8f92 server-1e6859002d2827ad`_$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h7ace9caf33e46c33 at future.rs:119:9
       frame #20: 0x0000000100bec911 server-1e6859002d2827ad`_$LT$datafusion..physical_plan..repartition..RepartitionExec$u20$as$u20$datafusion..physical_plan..ExecutionPlan$GT$::execute::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h4b59ba5224a2ad9d at repartition.rs:158:38
       frame #21: 0x0000000100e747b7 server-1e6859002d2827ad`_$LT$core..future..from_generator..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h977b694b706c4d95 at mod.rs:80:19
       frame #22: 0x0000000100d88f6b server-1e6859002d2827ad`tokio::runtime::task::core::CoreStage$LT$T$GT$::poll::_$u7b$$u7b$closure$u7d$$u7d$::hbd315ad252545124 at core.rs:235:17
       frame #23: 0x0000000100e11caa server-1e6859002d2827ad`tokio::loom::std::unsafe_cell::UnsafeCell$LT$T$GT$::with_mut::hfc17ddb5ca33336f at unsafe_cell.rs:14:9
       frame #24: 0x0000000100d88a12 server-1e6859002d2827ad`tokio::runtime::task::core::CoreStage$LT$T$GT$::poll::hf0681040537596bd at core.rs:225:13
       frame #25: 0x0000000100ec135b server-1e6859002d2827ad`tokio::runtime::task::harness::poll_future::_$u7b$$u7b$closure$u7d$$u7d$::hb06f082e610e57bf at harness.rs:422:23
       frame #26: 0x0000000100e919d4 server-1e6859002d2827ad`_$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h154c398e8c1bb3db at panic.rs:344:9
       frame #27: 0x0000000100bb86b2 server-1e6859002d2827ad`std::panicking::try::do_call::h2b25b8ca49972869 at panicking.rs:379:40
       frame #28: 0x0000000100bf05bd server-1e6859002d2827ad`__rust_try + 29
       frame #29: 0x0000000100bb8053 server-1e6859002d2827ad`std::panicking::try::h53a13b4a74456470 at panicking.rs:343:19
       frame #30: 0x0000000100e93544 server-1e6859002d2827ad`std::panic::catch_unwind::h0651651a99370337 at panic.rs:431:14
       frame #31: 0x0000000100ec04aa server-1e6859002d2827ad`tokio::runtime::task::harness::poll_future::hac7d79340e2f11c0 at harness.rs:409:19
       frame #32: 0x0000000100ec1b44 server-1e6859002d2827ad`tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll_inner::h929e19668fe1881b at harness.rs:89:9
       frame #33: 0x0000000100ec41f5 server-1e6859002d2827ad`tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll::h021f729a6cd9ca53 at harness.rs:59:15
       frame #34: 0x0000000100cd331a server-1e6859002d2827ad`tokio::runtime::task::raw::poll::hc8e86353c5f21a43 at raw.rs:104:5
       frame #35: 0x0000000102d9bc1a server-1e6859002d2827ad`tokio::runtime::task::raw::RawTask::poll::he0d0bd944eedc582 at raw.rs:66:18
       frame #36: 0x0000000102df7b9d server-1e6859002d2827ad`tokio::runtime::task::Notified$LT$S$GT$::run::ha88d677cd6f3149c at mod.rs:171:9
       frame #37: 0x0000000102d9d603 server-1e6859002d2827ad`tokio::runtime::thread_pool::worker::Context::run_task::_$u7b$$u7b$closure$u7d$$u7d$::hf9e6cd9dff39f6f4 at worker.rs:370:21
       frame #38: 0x0000000102ddd2f3 server-1e6859002d2827ad`tokio::coop::with_budget::_$u7b$$u7b$closure$u7d$$u7d$::h0ec22c0a28de52c9 at coop.rs:106:9
       frame #39: 0x0000000102e18c41 server-1e6859002d2827ad`std::thread::local::LocalKey$LT$T$GT$::try_with::hb84d8f10b1485fa8 at local.rs:272:16
       frame #40: 0x0000000102e17358 server-1e6859002d2827ad`std::thread::local::LocalKey$LT$T$GT$::with::h21f69cf09b330a35 at local.rs:248:9
       frame #41: 0x0000000102d9d2f7 server-1e6859002d2827ad`tokio::runtime::thread_pool::worker::Context::run_task::hc6d6db7c89075efa [inlined] tokio::coop::with_budget::h55fe928aaaffe5ff at coop.rs:99:5
       frame #42: 0x0000000102d9d2d0 server-1e6859002d2827ad`tokio::runtime::thread_pool::worker::Context::run_task::hc6d6db7c89075efa [inlined] tokio::coop::budget::h0abc7ebd8e471e0c at coop.rs:76
       frame #43: 0x0000000102d9d2a3 server-1e6859002d2827ad`tokio::runtime::thread_pool::worker::Context::run_task::hc6d6db7c89075efa at worker.rs:348
       frame #44: 0x0000000102d9cee9 server-1e6859002d2827ad`tokio::runtime::thread_pool::worker::Context::run::hf99da91a3c00dba2 at worker.rs:318:24
       frame #45: 0x0000000102d9cd8d server-1e6859002d2827ad`tokio::runtime::thread_pool::worker::run::_$u7b$$u7b$closure$u7d$$u7d$::h77fe136659c5a72d at worker.rs:303:17
       frame #46: 0x0000000102df5cb1 server-1e6859002d2827ad`tokio::macros::scoped_tls::ScopedKey$LT$T$GT$::set::hed7ebe413ed2161b at scoped_tls.rs:61:9
       frame #47: 0x0000000102d9ccd5 server-1e6859002d2827ad`tokio::runtime::thread_pool::worker::run::hc715ec1cf1fb0be9 at worker.rs:300:5
       frame #48: 0x0000000102d9cbc9 server-1e6859002d2827ad`tokio::runtime::thread_pool::worker::Launch::launch::_$u7b$$u7b$closure$u7d$$u7d$::h78ec4c11ad7b2d01 at worker.rs:279:45
       frame #49: 0x0000000102da3f29 server-1e6859002d2827ad`_$LT$tokio..runtime..blocking..task..BlockingTask$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h7843354493946fb1 at task.rs:42:21
       frame #50: 0x0000000102de8c30 server-1e6859002d2827ad`tokio::runtime::task::core::CoreStage$LT$T$GT$::poll::_$u7b$$u7b$closure$u7d$$u7d$::h532dd0e7c08bf50b at core.rs:235:17
       frame #51: 0x0000000102dc9968 server-1e6859002d2827ad`tokio::loom::std::unsafe_cell::UnsafeCell$LT$T$GT$::with_mut::h36b54f87a07ad4fc at unsafe_cell.rs:14:9
       frame #52: 0x0000000102de89a7 server-1e6859002d2827ad`tokio::runtime::task::core::CoreStage$LT$T$GT$::poll::h21616d2ae7e602ec at core.rs:225:13
       frame #53: 0x0000000102db9850 server-1e6859002d2827ad`tokio::runtime::task::harness::poll_future::_$u7b$$u7b$closure$u7d$$u7d$::h4b0424d9e9b89ec9 at harness.rs:422:23
       frame #54: 0x0000000102d8f0ed server-1e6859002d2827ad`_$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h85333023f211c42e at panic.rs:344:9
       frame #55: 0x0000000102e023ac server-1e6859002d2827ad`std::panicking::try::do_call::hdca936043be8477f at panicking.rs:379:40
       frame #56: 0x0000000102e0b16d server-1e6859002d2827ad`__rust_try + 29
       frame #57: 0x0000000102e01895 server-1e6859002d2827ad`std::panicking::try::h373fe6fa1e45df8c at panicking.rs:343:19
       frame #58: 0x0000000102d8f714 server-1e6859002d2827ad`std::panic::catch_unwind::h2425008be81ea154 at panic.rs:431:14
       frame #59: 0x0000000102db951a server-1e6859002d2827ad`tokio::runtime::task::harness::poll_future::hce7adea8bbd0e43c at harness.rs:409:19
       frame #60: 0x0000000102db603b server-1e6859002d2827ad`tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll_inner::h62b194c74e17a282 at harness.rs:89:9
       frame #61: 0x0000000102db59e5 server-1e6859002d2827ad`tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll::h1e112874f2e30e1f at harness.rs:59:15
       frame #62: 0x0000000102d9bd8a server-1e6859002d2827ad`tokio::runtime::task::raw::poll::h79fe28a3531b044d at raw.rs:104:5
       frame #63: 0x0000000102d9bc1a server-1e6859002d2827ad`tokio::runtime::task::raw::RawTask::poll::he0d0bd944eedc582 at raw.rs:66:18
       frame #64: 0x0000000102df7b3d server-1e6859002d2827ad`tokio::runtime::task::Notified$LT$S$GT$::run::h17bac5a680a82511 at mod.rs:171:9
       frame #65: 0x0000000102e1cdbb server-1e6859002d2827ad`tokio::runtime::blocking::pool::Inner::run::hb6f40314224f29be at pool.rs:278:17
       frame #66: 0x0000000102e1cbd4 server-1e6859002d2827ad`tokio::runtime::blocking::pool::Spawner::spawn_thread::_$u7b$$u7b$closure$u7d$$u7d$::hf7fa309ffdf749e8 at pool.rs:258:17
       frame #67: 0x0000000102d96664 server-1e6859002d2827ad`std::sys_common::backtrace::__rust_begin_short_backtrace::h0535451db6389c7b at backtrace.rs:125:18
       frame #68: 0x0000000102dc7831 server-1e6859002d2827ad`std::thread::Builder::spawn_unchecked::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h5165f94e91ca9833 at mod.rs:474:17
       frame #69: 0x0000000102d8f151 server-1e6859002d2827ad`_$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h9ba91e0ecb6fe51d at panic.rs:344:9
       frame #70: 0x0000000102e02289 server-1e6859002d2827ad`std::panicking::try::do_call::h9618232e36f91c79 at panicking.rs:379:40
       frame #71: 0x0000000102e0b16d server-1e6859002d2827ad`__rust_try + 29
       frame #72: 0x0000000102e01fcd server-1e6859002d2827ad`std::panicking::try::hff1e761505ccac31 at panicking.rs:343:19
       frame #73: 0x0000000102d8f781 server-1e6859002d2827ad`std::panic::catch_unwind::h3c3409c4f2e16628 at panic.rs:431:14
       frame #74: 0x0000000102dc767d server-1e6859002d2827ad`std::thread::Builder::spawn_unchecked::_$u7b$$u7b$closure$u7d$$u7d$::hb13e53027668ca11 at mod.rs:473:30
       frame #75: 0x0000000102deabed server-1e6859002d2827ad`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hff33fbdfd11b20f5 at function.rs:227:5
       frame #76: 0x0000000102f0eb1d server-1e6859002d2827ad`std::sys::unix::thread::Thread::new::thread_start::ha736b2d9de7b4dbc [inlined] _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::h9a277936be839d91 at boxed.rs:1521:9 [opt]
       frame #77: 0x0000000102f0eb17 server-1e6859002d2827ad`std::sys::unix::thread::Thread::new::thread_start::ha736b2d9de7b4dbc [inlined] _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::h87f71be231597a74 at boxed.rs:1521 [opt]
       frame #78: 0x0000000102f0eb0e server-1e6859002d2827ad`std::sys::unix::thread::Thread::new::thread_start::ha736b2d9de7b4dbc at thread.rs:71 [opt]
       frame #79: 0x00007fff72923109 libsystem_pthread.dylib`_pthread_start + 148
       frame #80: 0x00007fff7291eb8b libsystem_pthread.dylib`thread_start + 15
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-926613216


   Here is a simple reproducer showing the problem:
   
   ```rust
   diff --git a/datafusion/src/physical_plan/expressions/binary.rs b/datafusion/src/physical_plan/expressions/binary.rs
   index e77b25c40..560fb514a 100644
   --- a/datafusion/src/physical_plan/expressions/binary.rs
   +++ b/datafusion/src/physical_plan/expressions/binary.rs
   @@ -1381,4 +1381,36 @@ mod tests {
                ))
            }
        }
   +
   +    #[test]
   +    fn relatively_deeply_nested() {
   +        // Reproducer for https://github.com/apache/arrow-datafusion/issues/419
   +
   +        // where even relatively shallow binary expressions overflowed
   +        // the stack in debug builds
   +
   +        let input: Vec<_> = vec![1, 2, 3, 4, 5].into_iter().map(Some).collect();
   +        let a : Int32Array = input.iter().collect();
   +
   +        let batch = RecordBatch::try_from_iter(vec![("a", Arc::new(a) as _)]).unwrap();
   +        let schema = batch.schema();
   +
   +        // build a left deep tree ((((a + a) + a) + a ....
   +        let tree_depth: i32 = 10;
   +        let expr = (0..tree_depth)
   +            .into_iter()
   +            .map(|_| col("a", schema.as_ref()).unwrap())
   +            .reduce(|l, r| binary_simple(l, Operator::Plus, r))
   +            .unwrap();
   +
   +        println!("Evaluating expr {:?}", expr);
   +        let result = expr
   +            .evaluate(&batch)
   +            .expect("evaluation")
   +            .into_array(batch.num_rows());
   +
   +        let expected: Int32Array = input.into_iter().map(|i| i.map(|i| i * tree_depth)).collect();
   +        assert_eq!(result.as_ref(), &expected);
   +    }
   +
    }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Igosuki removed a comment on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
Igosuki removed a comment on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-917626393






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Igosuki commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
Igosuki commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-917625490


   I'm getting random test failures on my machine : 
   ```
   cargo test
   thread 'tests::run_q6' has overflowed its stack
   fatal runtime error: stack overflow
   error: test failed, to rerun pass '-p arrow-benchmarks --bin tpch'
   ```
   But then 
   ```
   cargo test -p arrow-benchmarks --bin tpch
   test tests::q10 ... ok
   test tests::q1 ... ok
   test tests::q11 ... ok
   test tests::q12 ... ok
   test tests::q13 ... ok
   test tests::q14 ... ok
   test tests::q15 ... ok
   test tests::q17 ... ok
   test tests::q16 ... ok
   test tests::q2 ... ok
   test tests::q18 ... ok
   test tests::q22 ... ok
   test tests::q19 ... ok
   test tests::q7 ... ok
   test tests::q6 ... ok
   test tests::q20 ... ok
   test tests::q4 ... ok
   test tests::q5 ... ok
   test tests::q9 ... ok
   test tests::q8 ... ok
   test tests::q21 ... ok
   test tests::q3 ... ok
   test tests::ballista_round_trip::q6 ... ok
   test tests::run_q6 ... ok
   test tests::run_q14 ... ok
   test tests::ballista_round_trip::q13 ... ok
   test tests::ballista_round_trip::q1 ... ok
   test tests::run_q12 ... ok
   test tests::run_q19 ... ok
   test tests::run_q13 ... ok
   test tests::run_q1 ... ok
   test tests::ballista_round_trip::q12 ... ok
   test tests::run_q3 ... ok
   test tests::ballista_round_trip::q3 ... ok
   test tests::run_q10 ... ok
   test tests::ballista_round_trip::q10 ... ok
   test tests::run_q9 ... ok
   test tests::run_q5 ... ok
   test tests::ballista_round_trip::q5 ... ok
   test tests::ballista_round_trip::q9 ... ok
   test tests::run_q7 ... ok
   test tests::ballista_round_trip::q7 ... ok
   test tests::ballista_round_trip::q8 ... ok
   test tests::run_q8 ... ok
   
   test result: ok. 44 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on issue #419: parquet::build_row_gropup_predicate hits stackoverflowed

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #419:
URL: https://github.com/apache/arrow-datafusion/issues/419#issuecomment-926176783


   Some observations:
   *  each stack frame of BinaryExpr::evaluate takes up 500K
   * If we run the test in release mode there are no problems
   * If we run with a larger stack frame there are no problems
   * there are only a few frames of the
   
   Thus my theory is that because there are so many locals created in `BinaryExpr::evaluate` (total, not in use any any one time), the debug build leaves a (unique) space for them all and thus each frame is bloated.
   
   I have prototyped fixing the stack error by splitting the `evaluate` function into several smaller ones (each with fewer variables and thus requiring less stack. I hope to have a PR up shortly.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org