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 accessing freed memory when instrumentation code un/instrumented itself #314

Merged
merged 4 commits into from
Feb 20, 2019

Conversation

pawelchcki
Copy link
Contributor

Description

In rare cases where instrumented code have actually removed/changed existing instrumentation of its own execution a freed pointer was accessed when removing recursion guard.

Readiness checklist

@pawelchcki pawelchcki changed the title Make dispatch_t pointer a smart pointer, to avoid accessing freed memory Fix accessing freed memory when instrumentation code un/instrumented itself Feb 20, 2019
@pawelchcki pawelchcki requested a review from SammyK February 20, 2019 14:50
@pawelchcki pawelchcki added 🐛 bug Something isn't working c-extension Apply this label to issues and prs related to the C-extension labels Feb 20, 2019
@pawelchcki pawelchcki added this to the 0.13.4 milestone Feb 20, 2019
@pawelchcki pawelchcki changed the title Fix accessing freed memory when instrumentation code un/instrumented itself WIP: Fix accessing freed memory when instrumentation code un/instrumented itself Feb 20, 2019
@pawelchcki pawelchcki changed the title WIP: Fix accessing freed memory when instrumentation code un/instrumented itself Fix accessing freed memory when instrumentation code un/instrumented itself Feb 20, 2019
Copy link
Contributor

@SammyK SammyK left a comment

Choose a reason for hiding this comment

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

Nice job fixing this @pawelchcki & @labbati for helping debug this! Just one little nit-pick on the test name. :)

tests/ext/used_dispatch_shouldn_t_be_freed.phpt Outdated Show resolved Hide resolved
@pawelchcki
Copy link
Contributor Author

thanks @SammyK for review. I added the missing test description 🤦‍♂️
Ready for another review round :D

@pawelchcki pawelchcki merged commit 4188827 into master Feb 20, 2019
@pawelchcki pawelchcki deleted the make_dispatch_pointer_a_smart_pointer branch February 20, 2019 16:05
estringana pushed a commit that referenced this pull request Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working c-extension Apply this label to issues and prs related to the C-extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants