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

Segmentation fault when running min_n max_n on big data set #759

Closed
oddfrost opened this issue May 24, 2023 · 3 comments · Fixed by #761
Closed

Segmentation fault when running min_n max_n on big data set #759

oddfrost opened this issue May 24, 2023 · 3 comments · Fixed by #761
Assignees
Labels
bug Something isn't working

Comments

@oddfrost
Copy link

Relevant system information:

  • OS: alma linux 8.7
  • PostgreSQL version: 14.7
  • TimescaleDB Toolkit version: 1.16.0
  • Installation method: timescaledb repo, self hosted package

Describe the bug
Postgres crashes when executing query like
select
min_n(metric, 2)
from table;

Data set (1 000 000+ rows)
In postgres log i can see message: server process was terminated by signal 11: Segmentation fault.

To Reproduce
Steps to reproduce the behavior:
CREATE TABLE public.test("time" timestamptz NOT NULL, duration int4 NULL);

SELECT create_hypertable('test', 'time');

Do $$
Begin
For r in 1..1000000 loop
Insert into test values(now() + (r||'s')::interval, r);
end loop;
End;
$$;

Select min_n(duration, 2) from test;

Expected behavior
Get result with smallest numbers (1, 2)

Actual behavior
Process crushes with segmentation fault (but it works on small data sets, with four rows).

@oddfrost oddfrost added the bug Something isn't working label May 24, 2023
@oddfrost
Copy link
Author

May be related to

#755

@jerryxwu
Copy link
Contributor

jerryxwu commented Jun 8, 2023

@oddfrost thank you for reporting the issue. I have reproduced the issue that you've experienced. We'll consider fixing it in an upcoming release.

@jerryxwu
Copy link
Contributor

jerryxwu commented Jul 7, 2023

@oddfrost If you haven't noticed yet, the fix has been included in the latest 1.17.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants