Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-12568

[Python][C++] Segfault when casting a sliced ListArray of int64 in v4.0.0

    XMLWordPrintableJSON

Details

    Description

      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:

      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")
      

      On pyarrow 3.0.0 I used to get

      ArrowNotImplementedError("Casting sliced lists (non-zero offset) not yet implemented")
      

      instead of the segfault.

      Thanks in advance for your help !

      Attachments

        Issue Links

          Activity

            People

              yibocai#1 yibocai#1
              lhoestq quentin lhoest
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m