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 memory leak in zos_pl_forward and add deallocation of tape signature to freeTapeResources #84

Merged
merged 5 commits into from
Nov 22, 2024

Conversation

AdrianSchmidt1
Copy link
Contributor

This PR includes two changes:

  1. It removes a redundant double *signature in the function zos_pl_forward in uni5_for.c which caused problems due to allocation but missing deallocation of memory.
  2. It adds freeing of the tape signature in the function freeTapeResources in taping.c which has previously been missing. This caused memory leaks when reusing tape IDs even when using the function removeTape before creating the new tape.

At a future point it would be very useful to add a note to the README.md which points out that the function removeTape must be called before rewriting a tape reusing a tape ID in one execution.
This workaround will prevent the aforementioned memory leak until ADOL-C adds the feature to automatically remove the tape before retaping in case the tape ID is reused. (Lot's of 'tape' in one sentence, hope it's clear what I mean)

@CLAassistant
Copy link

CLAassistant commented Nov 22, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.95%. Comparing base (fbd8948) to head (6c58e40).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #84      +/-   ##
==========================================
+ Coverage   65.64%   65.95%   +0.31%     
==========================================
  Files          50       51       +1     
  Lines       26438    26473      +35     
  Branches     1841     1843       +2     
==========================================
+ Hits        17355    17461     +106     
+ Misses       9083     9012      -71     
Flag Coverage Δ
unittests 65.95% <100.00%> (+0.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@TimSiebert1 TimSiebert1 merged commit 509590c into coin-or:master Nov 22, 2024
30 of 39 checks passed
@AdrianSchmidt1 AdrianSchmidt1 deleted the fix-signature-memory-leaks branch November 22, 2024 13:28
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.

3 participants