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

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   On my x86_64 Linux machine, I can get a SIGFPE crash with code like this 
under PyArrow 20,
   
   ```python
   import pyarrow as pa
   import pyarrow.parquet as pq
   
   schema = pa.schema([])
   empty_table = pa.Table.from_batches([], schema=schema)
   parquet_file_path = "empty_file.parquet"
   pq.write_table(empty_table, parquet_file_path)
   parquet_file = pq.ParquetFile(parquet_file_path)
   chunks = parquet_file.iter_batches(batch_size=0)
   for idx, chunk in enumerate(chunks):
       df = chunk # <-- doing anything with chunk crashes
   ```
   
   The crash is:
   
   ```
   Thread 1 "python" received signal SIGFPE, Arithmetic exception.
   
   #0  0x00007ffff4b6314e in parquet::arrow::(anonymous 
namespace)::FileReaderImpl::GetRecordBatchReader(std::vector<int, 
std::allocator<int> > const&, std::vector<int, std::allocator<int> > const&) () 
from /work/.venv/lib/python3.13/site-packages/pyarrow/libparquet.so.2000
   #1  0x00007ffff4b6355a in parquet::arrow::(anonymous 
namespace)::FileReaderImpl::GetRecordBatchReader(std::vector<int, 
std::allocator<int> > const&) () from 
/work/.venv/lib/python3.13/site-packages/pyarrow/libparquet.so.2000
   #2  0x00007ffff57da45e in 
__pyx_gb_7pyarrow_8_parquet_13ParquetReader_10generator(__pyx_CoroutineObject*, 
_ts*, _object*) () from 
/work/.venv/lib/python3.13/site-packages/pyarrow/_parquet.cpython-313-x86_64-linux-gnu.so
   #3  0x00007ffff5b1aac7 in __Pyx_Coroutine_SendEx(__pyx_CoroutineObject*, 
_object*, int) [clone .constprop.0] () from 
/work/.venv/lib/python3.13/site-packages/pyarrow/lib.cpython-313-x86_64-linux-gnu.so
   #4  0x00007ffff6b1c373 in enum_next () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #5  0x00007ffff6baade3 in _PyEval_EvalFrameDefault () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #6  0x00007ffff6d36f6a in PyEval_EvalCode () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #7  0x00007ffff6d34f95 in builtin_exec () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #8  0x00007ffff6baad20 in _PyEval_EvalFrameDefault () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #9  0x00007ffff6d36f6a in PyEval_EvalCode () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #10 0x00007ffff6d34f95 in builtin_exec () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #11 0x00007ffff6b522c6 in 
cfunction_vectorcall_FASTCALL_KEYWORDS.llvm.2372027649757183752 () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #12 0x00007ffff6ba9682 in _PyEval_EvalFrameDefault () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #13 0x00007ffff6da9c86 in pymain_run_module () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #14 0x00007ffff6a3d4c9 in pymain_run_stdin () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #15 0x00007ffff6da93d3 in Py_RunMain () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #16 0x00007ffff6da9aba in pymain_main () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #17 0x00007ffff6da9b7c in Py_BytesMain () from 
/home/bryce/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/../lib/libpython3.13.so.1.0
   #18 0x00007ffff6537ca8 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
   #19 0x00007ffff6537d65 in __libc_start_main () from 
/lib/x86_64-linux-gnu/libc.so.6
   #20 0x00000000006000a9 in _start ()
   ```
   
   I don't see the crash,
   
   - on macOS
   - If I specify a non-empty Schema or
   - If I specify a non-zero batch_size to iter_batches
   
   ### Component(s)
   
   C++, 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: issues-unsubscr...@arrow.apache.org.apache.org

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

Reply via email to