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 use-after-free #812

Merged
merged 2 commits into from
Oct 28, 2015
Merged

Fix use-after-free #812

merged 2 commits into from
Oct 28, 2015

Conversation

codemercenary
Copy link
Contributor

This issue occurs because it's possible for the current dispatcher to wake up, dispatch an entire chain, and go back to sleep between when a removal request is pended and when it's released. Unfortunately, the release step causes the chain to be destroyed, which means that if we have no way to detect the destruction of the chain we will wind up dereferencing freed memory.

Add a chain counter concept and detect modifications to the chain ID when inserting a new chain; use this to decide whether to obtain ownership or to consider the work request completed.

  • Verify that 10k iterations of PathologicalSyncTest pass on Windows Debug x86

This issue occurs because it's possible for the current dispatcher to wake up, dispatch an entire chain, and go back to sleep between when a removal request is pended and when it's released.  Unfortunately, the release step causes the chain to be destroyed, which means that if we have no way to detect the destruction of the chain we will wind up dereferencing freed memory.

Add a chain counter concept and detect modifications to the chain ID when inserting a new chain; use this to decide whether to obtain ownership or to consider the work request completed.
veronicaz41 pushed a commit that referenced this pull request Oct 28, 2015
@veronicaz41 veronicaz41 merged commit 5e1a27c into develop Oct 28, 2015
@veronicaz41 veronicaz41 deleted the fix-chainid branch October 28, 2015 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants