Skip to content

Fix GH-9361: Segmentation fault on script exit #9379

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

Closed
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Aug 19, 2022

Using a lot of memory may overflow some int calculations; to avoid
that we make sure that the operands are promoted to size_t.

This issue has been analyzed by @chschneider.

Using a lot of memory may overflow some `int` calculations; to avoid
that we make sure that the operands are promoted to `size_t`.

This issue has been analyzed by @chschneider.
@cmb69 cmb69 linked an issue Aug 19, 2022 that may be closed by this pull request
@staabm
Copy link
Contributor

staabm commented Aug 19, 2022

Maybe add a test like #9361 (comment) ?

@cmb69
Copy link
Member Author

cmb69 commented Aug 19, 2022

Maybe add a test like #9361 (comment) ?

memory_limit=10G. Really?

@staabm
Copy link
Contributor

staabm commented Aug 19, 2022

I guess you could usw the same script with less iterations and a smaller limit?

Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LCTM

@cmb69
Copy link
Member Author

cmb69 commented Aug 19, 2022

I guess you could usw the same script with less iterations and a smaller limit?

That might not trigger the overflow.

@chschneider
Copy link
Contributor

Yes, you need heap->cached_chunks_count to become big enough to trigger the overflow so reducing the memory limit and/or less iterations won't trigger it.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cmb69!

Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. @chschneider thanks for catching this.

@cmb69 cmb69 closed this in bb34121 Aug 22, 2022
@cmb69 cmb69 deleted the cmb/9361 branch August 22, 2022 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault on script exit
6 participants