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

Keep instrumentation enabled on tests with multithreading. #35

Closed
xd009642 opened this issue Aug 28, 2017 · 6 comments
Closed

Keep instrumentation enabled on tests with multithreading. #35

xd009642 opened this issue Aug 28, 2017 · 6 comments
Labels
enhancement Instrumentation Issues relating to ptrace and parsing of DWARF tables

Comments

@xd009642
Copy link
Owner

From #21 instrumentation was disabled after it was first hit when the test or function tested contained multi-threaded code. This prevented a race condition with ptrace pokes, but disrupts the hit count.

The hit count isn't too meaningful a statistic so it's low priority, however this is necessary for decision or condition coverage so will need to be sorted for that.

@philipc
Copy link
Contributor

philipc commented Oct 5, 2017

I had a look at the current code for handling threads, and I don't really understand what it is doing. It looks like it is trying to keep an is_running state for each breakpoint per thread, but I don't think you can do that because threads share the same code page, so they all have the same breakpoint status. Maybe you should be indexing is_running by TGID instead of TID.

@xd009642
Copy link
Owner Author

xd009642 commented Oct 5, 2017

You're 100% right on what the code is doing! And thanks for that tip, I'll admit I'm still learning about some of the intricacies of TIDs and TGIDs.

I'll look into this at some point, just got some issues I'm working on right now that I'd like to finish before I move onto other tasks 👍

@mathstuf
Copy link
Contributor

FWIW, using RAYON_NUM_THREADS=1 helps a lot here for crates using Rayon at least.

@mathstuf
Copy link
Contributor

Ping @xd009642 Any luck with the TGID/TID stuff?

@xd009642
Copy link
Owner Author

Nope no luck at all, I got stuck and decided to shelve it for now. Unless anyone else has any bright ideas!

xd009642 added a commit that referenced this issue Jun 2, 2018
Improves user experience for #35 but doesn't fix problem
@xd009642 xd009642 added the Instrumentation Issues relating to ptrace and parsing of DWARF tables label Jul 23, 2018
@xd009642
Copy link
Owner Author

Closed, the solution for #190 fixed this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Instrumentation Issues relating to ptrace and parsing of DWARF tables
Projects
None yet
Development

No branches or pull requests

3 participants