You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Yibo Cai (Jira)" <ji...@apache.org> on 2021/04/28 05:50:00 UTC

[jira] [Commented] (ARROW-12568) [Python][C++] Segfault when casting a sliced ListArray of int64 in v4.0.0

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

Yibo Cai commented on ARROW-12568:
----------------------------------

From gdb, the error is at https://github.com/apache/arrow/blob/3a6f6053c74eb698208395091009ac50be9dc29e/cpp/src/arrow/compute/kernels/scalar_cast_nested.cc#L69

Second augment "in_array.buffers[0]->data()" deferences nullptr as "in_array.buffers[0]" can be null.

Looks a critical bug.

> [Python][C++] Segfault when casting a sliced ListArray of int64 in v4.0.0
> -------------------------------------------------------------------------
>
>                 Key: ARROW-12568
>                 URL: https://issues.apache.org/jira/browse/ARROW-12568
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++, Python
>    Affects Versions: 4.0.0
>            Reporter: quentin lhoest
>            Priority: Major
>              Labels: segfault
>
> Hi !
> I just updated to pyarrow 4.0.0 and I noticed that a segfault happens when casting a sliced ListArray of int64. It crashes on both linux and windows. Here is a code to reproduce:
> {code:python}
> import pyarrow as pa
> arr = pa.array([[i * 10] for i in range(4)])
> print(type(arr))  # <class 'pyarrow.lib.ListArray'>
> print(arr.type)  # list<item: int64>
> arr.cast(pa.list_(pa.int32()))  # works
> print(">>> Casting without slicing works")
> arr = arr.slice(1)
> print(type(arr))  # <class 'pyarrow.lib.ListArray'>
> print(arr.type)  # list<item: int64>
> arr.cast(pa.list_(pa.int32()))  # crashes !!
> print(">>> This message isn't printed because casting with slicing causes a segfault")
> {code}
> On pyarrow 3.0.0 I used to get
> {code:python}
> ArrowNotImplementedError("Casting sliced lists (non-zero offset) not yet implemented")
> {code}
>  instead of the segfault.
> Thanks in advance for your help !



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