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

Alternative to Fix invalid memory accesses to 'GloVars::checksums_values' during shutdown #4189

Merged
merged 3 commits into from
Apr 25, 2023

Conversation

renecannao
Copy link
Contributor

This is an alternative implementation of commit cfb34ef because it was failing to compile on clang 14 , that was complaining about a missing unnamed destructor

…ues' during shutdown

This is an alternative implementation of commit cfb34ef
because it was failing to compile on clang 14 , that was complaining about
a missing unnamed destructor
@renecannao
Copy link
Contributor Author

@JavierJF : your feedback is needed

@renecannao
Copy link
Contributor Author

retest this please

1 similar comment
@renecannao
Copy link
Contributor Author

retest this please

Copy link
Collaborator

@JavierJF JavierJF left a comment

Choose a reason for hiding this comment

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

This solution should work. But since the original type ProxySQL_Checksum_Value is only through its derived class ProxySQL_Checksum_Value_2 in the contexts in which resource deallocation is needed. I think we could get the shutdown logic out of the picture, and make a pure inheritance based solution. Just removing the destructor from ProxySQL_Checksum_Value and leaving that responsibility to the derived classes (right now only ProxySQL_Checksum_Value_2). Patch could be something minimal like the following:

inheritance_solution.patch.tar.gz

Note: It will be required to remove the call to ProxySQL_Checksum_Value ctor from ProxySQL_Checksum_Value2 ctor, since its creating an empty object that is currently never used, but once the destructor is removed, this empty object will leak resources.

@renecannao renecannao merged commit d3ce2e9 into v2.x Apr 25, 2023
@renecannao renecannao deleted the v2.x-glovars_shutdown branch August 29, 2024 11:20
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.

2 participants