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

Fix small chunk finaliser premature re-use bug #2335

Merged
merged 1 commit into from
Nov 15, 2017

Conversation

dipinhora
Copy link
Contributor

Prior to this commit, if a small chunk was partially used after GC
and had finalisers to be run for the freed slots, the execution of
the finaliser could end up reusing the slots for which finalisers
were being run. If this occurred, it would lead to unpredictable
results (a segfault in my case).

This commit changes the order of operations to ensure that all the
finalisers are run prior to the chunk being added back to the
available list ensuring that the execution of the finaliser cannot
allocate slots that are still to be finalised.

Prior to this commit, if a small chunk was partially used after GC
and had finalisers to be run for the freed slots, the execution of
the finaliser could end up reusing the slots for which finalisers
were being run. If this occurred, it would lead to unpredictable
results (a segfault in my case).

This commit changes the order of operations to ensure that all the
finalisers are run prior to the chunk being added back to the
available list ensuring that the execution of the finaliser cannot
allocate slots that are still to be finalised.
@dipinhora dipinhora added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Nov 13, 2017
@SeanTAllen SeanTAllen merged commit fdfa49e into ponylang:master Nov 15, 2017
ponylang-main added a commit that referenced this pull request Nov 15, 2017
@SeanTAllen
Copy link
Member

Thanks @dipinhora!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants