Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault / capacity overflow caused by agg + concat_list + struct + quantile #15834

Closed
2 tasks done
cmdlineluser opened this issue Apr 22, 2024 · 0 comments · Fixed by #15891
Closed
2 tasks done

Segfault / capacity overflow caused by agg + concat_list + struct + quantile #15834

cmdlineluser opened this issue Apr 22, 2024 · 0 comments · Fixed by #15891
Assignees
Labels
accepted Ready for implementation bug Something isn't working P-high Priority: high python Related to Python Polars

Comments

@cmdlineluser
Copy link
Contributor

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

import polars as pl

df = pl.read_csv(b"""
group,value
1,0.1973209146402105
2,0.13380719982405365
1,0.6152394463707009
2,0.4558767896005155
""".strip())

df.group_by("group").agg(
   pl.concat_list(
      pl.struct(quantile=1, value=pl.col("value").quantile(1))
   )
)

Log output

file < 128 rows, no statistics determined
no. of chunks: 1 processed by: 1 threads.
keys/aggregates are not partitionable: running default HASH AGGREGATION
zsh: segmentation fault

Issue description

The example either segfaults or raises a PanicException

thread 'polars-1' panicked at library/alloc/src/raw_vec.rs:25:5:
capacity overflow

It seems to try and allocate massive amounts of memory.

Expected behavior

Run without error.

Installed versions

--------Version info---------
Polars:               0.20.22
Index type:           UInt32
Platform:             macOS-13.6.1-arm64-arm-64bit
Python:               3.12.2 (main, Feb  6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          <not installed>
connectorx:           <not installed>
deltalake:            <not installed>
fastexcel:            <not installed>
fsspec:               <not installed>
gevent:               <not installed>
hvplot:               <not installed>
matplotlib:           <not installed>
nest_asyncio:         <not installed>
numpy:                1.26.4
openpyxl:             <not installed>
pandas:               2.2.1
pyarrow:              15.0.2
pydantic:             <not installed>
pyiceberg:            <not installed>
pyxlsb:               <not installed>
sqlalchemy:           <not installed>
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@cmdlineluser cmdlineluser added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Apr 22, 2024
@cmdlineluser cmdlineluser changed the title Segfault./ capacity overflow caused by agg + concat_list + quantile Segfault / capacity overflow caused by agg + concat_list + quantile Apr 22, 2024
@cmdlineluser cmdlineluser changed the title Segfault / capacity overflow caused by agg + concat_list + quantile Segfault / capacity overflow caused by agg + concat_list + struct + quantile Apr 23, 2024
@orlp orlp added P-high Priority: high and removed needs triage Awaiting prioritization by a maintainer labels Apr 23, 2024
@c-peters c-peters added the accepted Ready for implementation label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation bug Something isn't working P-high Priority: high python Related to Python Polars
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants