You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Weston Pace (Jira)" <ji...@apache.org> on 2021/02/25 17:22:00 UTC

[jira] [Commented] (ARROW-11780) [C++] StructArray.from_arrays() crashes Python interpreter

    [ https://issues.apache.org/jira/browse/ARROW-11780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17291063#comment-17291063 ] 

Weston Pace commented on ARROW-11780:
-------------------------------------

Relevant stack trace...


{code:java}
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffff5ed7f16 in std::__shared_ptr<arrow::ArrayData, (__gnu_cxx::_Lock_policy)2>::get (this=0x8) at /home/pace/anaconda3/envs/conbench2/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/shared_ptr_base.h:1310
1310	      { return _M_ptr; }
(gdb) bt
#0  0x00007ffff5ed7f16 in std::__shared_ptr<arrow::ArrayData, (__gnu_cxx::_Lock_policy)2>::get (this=0x8)
    at /home/pace/anaconda3/envs/conbench2/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/shared_ptr_base.h:1310
#1  0x00007ffff5ed4f91 in std::__shared_ptr_access<arrow::ArrayData, (__gnu_cxx::_Lock_policy)2, false, false>::_M_get (this=0x8)
    at /home/pace/anaconda3/envs/conbench2/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/shared_ptr_base.h:1021
#2  0x00007ffff5ed20df in std::__shared_ptr_access<arrow::ArrayData, (__gnu_cxx::_Lock_policy)2, false, false>::operator-> (this=0x8)
    at /home/pace/anaconda3/envs/conbench2/x86_64-conda-linux-gnu/include/c++/9.3.0/bits/shared_ptr_base.h:1015
#3  0x00007ffff5ece259 in arrow::Array::type (this=0x0) at ../src/arrow/array/array_base.h:86
#4  0x00007ffff5f75924 in arrow::StructArray::Make (children=std::vector of length 2, capacity 2 = {...}, field_names=std::vector of length 2, capacity 2 = {...}, 
    null_bitmap=std::shared_ptr<arrow::Buffer> (empty) = {...}, null_count=-1, offset=0) at ../src/arrow/array/array_nested.cc:502
#5  0x00007ffff73c7b89 in __pyx_pf_7pyarrow_3lib_11StructArray_4from_arrays(_object*, _object*, _object*) ()
   from /home/pace/anaconda3/envs/conbench2/lib/python3.7/site-packages/pyarrow-4.0.0.dev108+g4b4fb24d3.d20210205-py3.7-linux-x86_64.egg/pyarrow/lib.cpython-37m-x86_64-linux-gnu.so
#6  0x00007ffff73c8ad1 in __pyx_pw_7pyarrow_3lib_11StructArray_5from_arrays(_object*, _object*, _object*) ()
   from /home/pace/anaconda3/envs/conbench2/lib/python3.7/site-packages/pyarrow-4.0.0.dev108+g4b4fb24d3.d20210205-py3.7-linux-x86_64.egg/pyarrow/lib.cpython-37m-x86_64-linux-gnu.so

{code}
It appears `StructArray::Make` is being called with children/field_names each with length 2.  The names get passed down but `table['foo']` and `table['bar']` become null pointers.

 

 

> [C++] StructArray.from_arrays() crashes Python interpreter
> ----------------------------------------------------------
>
>                 Key: ARROW-11780
>                 URL: https://issues.apache.org/jira/browse/ARROW-11780
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++, Python
>    Affects Versions: 3.0.0
>            Reporter: ARF
>            Priority: Major
>
> {{StructArray.from_arrays()}} crashes the Python interpreter without error message:
> {code:none}
> (test_pyarrow) Z:\test_pyarrow>python
> Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import pyarrow as pa
> >>>
> >>> table = pa.Table.from_pydict({
> ...     'foo': pa.array([1, 2, 3]),
> ...     'bar': pa.array([4, 5, 6])
> ... })
> >>>
> >>> pa.StructArray.from_arrays([table['foo'], table['bar']], ['foo', 'bar'])
> (test_pyarrow) Z:\test_pyarrow>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)