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

Trace down into launched binaries. #107

Closed
xd009642 opened this issue May 1, 2018 · 5 comments
Closed

Trace down into launched binaries. #107

xd009642 opened this issue May 1, 2018 · 5 comments
Labels
BIG-TASK For tasks which seem very big. enhancement

Comments

@xd009642
Copy link
Owner

xd009642 commented May 1, 2018

This is a big change and probably quite challenging but here it goes.

Given a test or program that uses a function like Command::spawn() or something like assert-cli which launches a new binary follow that binary down and get coverage of it's code. The steps to do this (as far as I can tell are)

  1. When an exec event comes in identify if the binary is in the target folder (use procfs) if it isn't detach ptrace otherwise:
  2. Run them through test_loader.rs to get a tracemap for them. Merge with existing tracemap (maybe after the next step)
  3. Catch the binary when it's launched and instrument it
  4. Carry on running as normal (but may need a way to distinguish which process a breakpoint belongs to)

This is just an initial impression, it may be missing details or not quite work. It's just a record of my thoughts and feelings regarding an initial approach. It does complicate the run time logic of tarpaulin so may involve a substantial redesign of numerous modules as well!

@xd009642
Copy link
Owner Author

Just updated the above with some recent thoughts after looking into this a bit. I'll look to prototyping something in a smaller example binary first as a proof of concept

@xd009642
Copy link
Owner Author

xd009642 commented Nov 7, 2020

I've got a prototype of following process exec's on #615 if you want to try it out. So far I've just tried it on a very simple toy project so more people testing it is appreciated 😄

@Ch00k
Copy link
Contributor

Ch00k commented Nov 8, 2020

@xd009642 Thanks so much for looking into this. I got the coverage calculated on my integration tests, that call the executable with process:Command. Here is the codecov report: https://codecov.io/gh/Ch00k/orthanc-cli/tree/d30f584c8494231a3330f30e5afbafef50432046/src

Let me me know if you need me to perform any more specific tests before you can merge the PR.

@xd009642
Copy link
Owner Author

xd009642 commented Nov 9, 2020

Right I've done some more testing and merged, forks don't work but exec does which I feel is the most important part anyway. I'll close this and tackle any issues as they arise when people upgrade 👍

@xd009642 xd009642 closed this as completed Nov 9, 2020
@xd009642
Copy link
Owner Author

xd009642 commented Nov 9, 2020

Following forks covered by this issue #616

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BIG-TASK For tasks which seem very big. enhancement
Projects
None yet
Development

No branches or pull requests

2 participants