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

Resolve memory leaks in ConcurrentMap, EpochManager, LockFreeStack, and LockFreeQueue #25928

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jabraham17
Copy link
Member

@jabraham17 jabraham17 commented Sep 11, 2024

Resolves all of the memory leaks that are exposed by our current tests in the ConcurrentMap, EpochManager, LockFreeStack, and LockFreeQueue modules

While working on this, I also found #25926 and this PR adds a future for that.

Testing

  • full paratest with/without comm
  • full paratest with -memleaks
  • full paratest with comm and -memleaks

[Reviewed by @stonea]

@jabraham17 jabraham17 marked this pull request as ready for review September 11, 2024 17:00
Signed-off-by: Jade Abraham <[email protected]>
Copy link
Contributor

@stonea stonea left a comment

Choose a reason for hiding this comment

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

Thanks for taking this on. It's certainly nice to get rid of that ugly memLeakTests/ folder!

@@ -568,7 +576,8 @@ module ConcurrentMap {
:yields: A copy of one of the keys contained in this map.
*/
iter keys() : keyType {
for (key, _) in this {
// dummy variable to workaround: https://github.com/chapel-lang/chapel/issues/25926
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is an issue you discovered while working on fixing the memory leaks here?

Assuming we don't already have a future for this, it'd be a nice thing to add. We have some job that tracks our "known memory leaks" so it would be good if that kept track of this.

AFAIK, @e-kayrakli is more familiar with what you'd need to do to make a future / failing test or whatever that would get tracked by that job.

Copy link
Contributor

Choose a reason for hiding this comment

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

For a test that is known to be leaking for something we are aware/have to accept, just add --memLeaks in its execopts so that it'll always print the leak table. Add the leak table to the good file, and prediff the memory addresses printed on it. See test/memory/ferguson/test1 for an example.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I found this bug while working on this, I just pushed a future

Signed-off-by: Jade Abraham <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants