WillAyd opened a new issue, #37650:
URL: https://github.com/apache/arrow/issues/37650

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   This is not correct code, but I did actually make this mistake and was 
puzzled for a while by the segfault (I thought I was passing a pyarrow.compute 
expression to filter)
   
   ```python
   >>> import pyarrow as pa
   >>> n_legs = pa.array([2, 4, 5, 100])
   >>> animals = pa.array(["Flamingo", "Horse", "Brittle stars", "Centipede"])
   >>> names = ["n_legs", "animals"]
   >>> tbl = pa.Table.from_arrays([n_legs, animals], names=names)
   >>> tbl.filter(tbl)  # meant to pass an pyarrow.compute.filter here
   Segmentation fault (core dumped)
   ```
   
   A gdb backtrace shows the following steps:
   
   ```sh
   #0  0x00007ffff5e5cfde in arrow::compute::internal::(anonymous 
namespace)::FilterMetaFunction::ExecuteImpl(std::vector<arrow::Datum, 
std::allocator<arrow::Datum> > const&, arrow::compute::FunctionOptions const*, 
arrow::compute::ExecContext*) const ()
      from 
/home/willayd/mambaforge/envs/scratchpad/lib/python3.11/site-packages/pyarrow/../../../libarrow.so.1200
   #1  0x00007ffff5d45d22 in 
arrow::compute::MetaFunction::Execute(std::vector<arrow::Datum, 
std::allocator<arrow::Datum> > const&, arrow::compute::FunctionOptions const*, 
arrow::compute::ExecContext*) const ()
      from 
/home/willayd/mambaforge/envs/scratchpad/lib/python3.11/site-packages/pyarrow/../../../libarrow.so.1200
   #2  0x00007fff8c91ea26 in 
__pyx_pf_7pyarrow_8_compute_8Function_6call(__pyx_obj_7pyarrow_8_compute_Function*,
 _object*, __pyx_obj_7pyarrow_8_compute_FunctionOptions*, 
__pyx_obj_7pyarrow_3lib_MemoryPool*, _object*) ()
      from 
/home/willayd/mambaforge/envs/scratchpad/lib/python3.11/site-packages/pyarrow/_compute.cpython-311-x86_64-linux-gnu.so
   #3  0x00005555557614c6 in method_vectorcall_VARARGS_KEYWORDS 
(func=<optimized out>, args=<optimized out>, nargsf=<optimized out>, 
       kwnames=<optimized out>) at 
/usr/local/src/conda/python-3.11.0/Objects/descrobject.c:364
   #4  0x000055555574bec1 in _PyObject_VectorcallTstate (kwnames=<optimized 
out>, nargsf=<optimized out>, args=<optimized out>, 
       callable=0x7fff8ca66fc0, tstate=0x555555ae0d98 <_PyRuntime+166328>) at 
/usr/local/src/conda/python-3.11.0/Include/internal/pycore_call.h:92
   #5  PyObject_Vectorcall (callable=0x7fff8ca66fc0, args=<optimized out>, 
nargsf=<optimized out>, kwnames=<optimized out>)
       at /usr/local/src/conda/python-3.11.0/Objects/call.c:299
   #6  0x000055555574169e in _PyEval_EvalFrameDefault (tstate=<optimized out>, 
frame=<optimized out>, throwflag=<optimized out>)
       at /usr/local/src/conda/python-3.11.0/Python/ceval.c:4772
   #7  0x0000555555767e81 in _PyEval_EvalFrame (throwflag=0, 
frame=0x7ffff7fb5080, tstate=0x555555ae0d98 <_PyRuntime+166328>)
       at /usr/local/src/conda/python-3.11.0/Include/internal/pycore_ceval.h:73
   #8  _PyEval_Vector (kwnames=<optimized out>, argcount=3, args=<optimized 
out>, locals=0x0, func=0x7fff8c824540, 
       tstate=0x555555ae0d98 <_PyRuntime+166328>) at 
/usr/local/src/conda/python-3.11.0/Python/ceval.c:6428
   #9  _PyFunction_Vectorcall (func=0x7fff8c824540, stack=<optimized out>, 
nargsf=<optimized out>, kwnames=<optimized out>)
       at /usr/local/src/conda/python-3.11.0/Objects/call.c:393
   #10 0x00007ffff6ea0411 in __Pyx_PyObject_Call(_object*, _object*, _object*) 
()
      from 
/home/willayd/mambaforge/envs/scratchpad/lib/python3.11/site-packages/pyarrow/lib.cpython-311-x86_64-linux-gnu.so
   #11 0x00007ffff6f34c0d in __pyx_pw_7pyarrow_3lib_5Table_19filter(_object*, 
_object*, _object*) ()
      from 
/home/willayd/mambaforge/envs/scratchpad/lib/python3.11/site-packages/pyarrow/lib.cpython-311-x86_64-linux-gnu.so
   ```
   
   
   ### Component(s)
   
   Python


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to