Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Add Memory Safety Tests #113

Open
3 tasks
eklitzke opened this issue Aug 8, 2017 · 1 comment
Open
3 tasks

Add Memory Safety Tests #113

eklitzke opened this issue Aug 8, 2017 · 1 comment

Comments

@eklitzke
Copy link
Collaborator

eklitzke commented Aug 8, 2017

I occasionally run Pyflame through valgrind, and it always gets a completely clean report. However, I'd like to test this more rigorously. Things I'd like to see:

  • Add tests that check that valgrind --tool=memcheck on Pyflame returns a clean output report
  • Add ASAN tests that build Pyflame with ASAN and make sure no errors are reported
  • Add tcmalloc heap checker tests (although I think the above two checks should really be sufficient)

I'd kind of like to write this as a separate library/framework, since I've wanted to do these kinds of tests with other C++ programs I've written. These should be written in a way that they're optional, so the tests will only run if the tools are actually available on the system. And of course, the Travis job should run the full suite of memory checking tests.

@eklitzke
Copy link
Collaborator Author

eklitzke commented Aug 8, 2017

For Vaglrind, it looks like you can fork the Valgrind process and give it --xml=yes and --xml-fd=FD where FD is a file descriptor you allocate using pipe(2). This will allow getting the Valgrind output on its own channel without using a temporary file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant