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

AccessRecorder does not increment maxHeapAlloc correctly in leaky code #45

Closed
ahueck opened this issue Dec 30, 2020 · 0 comments · Fixed by #48
Closed

AccessRecorder does not increment maxHeapAlloc correctly in leaky code #45

ahueck opened this issue Dec 30, 2020 · 0 comments · Fixed by #48
Labels
bug Something isn't working

Comments

@ahueck
Copy link
Contributor

ahueck commented Dec 30, 2020

Currently, maxHeapAlloc is only incremented when a free heap operation triggers in a target code.

Hence, in a code without free, the max heap is incorrectly printed:

int main(void) {
  for (int i = 1; i <= 6; ++i) {
    // 6 heap alloc, max heap (concurrently) 6
    double* d = (double*)malloc(sizeof(double));
  }
  return 0;
}

-> Prints: Max. Heap Allocs 0 but expeced is 6.

Fix

AccessRecorder calculates max. for every heap allocation "just in time", instead of waiting for a free.

@ahueck ahueck added the bug Something isn't working label Dec 30, 2020
@ahueck ahueck mentioned this issue Jan 4, 2021
ahueck added a commit that referenced this issue Jan 4, 2021
* lit support softcounter feature for tests

* script parse and stack update, fix #43 and #44

* test accessrecorder with leaky code, fixes #45

* separate softcounter printer and use getter for fields

* add pseudo targets for tests, this helps clion ide

* fix lit keyword for required; CI use softcounter always
@ahueck ahueck mentioned this issue Jan 4, 2021
@ahueck ahueck closed this as completed in #48 Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant