-
Notifications
You must be signed in to change notification settings - Fork 42
Fix disjoint_pool_free() and proxy_free() #1157
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 disjoint_pool_free() and proxy_free() #1157
Conversation
| return ret; | ||
| } | ||
|
|
||
| if (pool != umfPoolGetPoolPriv(allocInfo.pool)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this check? It breaks encapsulation because now pool implementation calls umfPoolGetPoolPriv.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check prevents from freeing a pointer from a different pool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vinser52 It is needed by #1143
See #1143 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure we should expose UMF internals to the pool implementation.
Furthermore, this solution works only for UMF's pools. If someone implements their pool what he/she should do in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR was replaced with #1161 - please review this new PR instead.
|
The name of this PR is misleading because it does not fix anything, it just introduces an additional check. But do we really need this check? |
|
Fix disjoint_pool_free() and proxy_free() - error out on pool mismatch, when we try to free the pointer belonging to a different pool. Signed-off-by: Lukasz Dorau <[email protected]>
5300876 to
32175d9
Compare
it is the ill-formed client. |
|
I'm not sure if adding this check in the pool is a good idea. As I understand, all other pools will NOT return an error if we try to free memory from a different pool (which is inconsistent). And even if we added this check to proxy_pool, jemalloc_pool, what about custom user pools? |
This PR was replaced with #1161 - please review this new PR instead. |
Description
Fix disjoint_pool_free() and proxy_free() - error out on pool mismatch, when we try to free the pointer
belonging to a different pool.
Checklist