Fix cleanup when tracking is interrupted by user
Needs RevisionPublic

Authored by antonanikin on Mar 6 2017, 7:27 AM.

Details

Reviewers
mwolff
Summary

The patch fixes cleanup for attach-to-process mode.

Old version behavior:

  1. Run some application.
  2. Attach heaptrack to it with heaptrack -p PID and wait for "injection finished" message.
  3. Break tracking with Ctrl-C.
  4. Result: cleanup() script function is NOT called and heaptrack_interpret process is still running.
Test Plan

Tested with Ctrl-C break from command line and also with kdev-heaptrack plugin (standard tool button "Kill Job").

Diff Detail

Repository
R45 Heaptrack
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
antonanikin created this revision.Mar 6 2017, 7:27 AM
antonanikin edited the test plan for this revision. (Show Details)Mar 6 2017, 7:33 AM
mwolff requested changes to this revision.Mar 19 2017, 1:18 PM

Can you please add more information? I also use "^C" to interrupt tracking and that used to work just fine for me. What is going wrong? Why is your trap line required? Add all of this information to the commit message

This revision now requires changes to proceed.Mar 19 2017, 1:18 PM
antonanikin edited the summary of this revision. (Show Details)Mar 20 2017, 4:28 AM
antonanikin edited the test plan for this revision. (Show Details)

@mwolff, ping ?

I still have the bug on my KDE neon User Edition 5.12 system with last heaptrack:

$ heaptrack -v
heaptrack 1.0.0