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

Don't fail when ptrace::detach returns ESRCH. #68

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

afranchuk
Copy link
Contributor

ESRCH indicates that the thread has disappeared while we had it stopped. We don't consider this an error.

Closes #29.

ESRCH indicates that the thread has disappeared while we had it stopped. We don't consider this an error.

Closes rust-minidump#29.
@afranchuk afranchuk requested a review from Jake-Shadle as a code owner January 5, 2023 19:16
@afranchuk
Copy link
Contributor Author

Note that we could probably add a test to cover this case; let me know if that's desirable (the existing tests fail on my local machine sometimes, I am going to look into that).

@gabrielesvelto gabrielesvelto self-requested a review January 7, 2023 13:45
@gabrielesvelto
Copy link
Contributor

If you have time to write a test that's always welcome! Also it seems that recent versions of clippy are complaining about redundant casts, could you address it in a separate commit within this PR? Thanks for your contribution!

Copy link
Contributor

@gabrielesvelto gabrielesvelto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually never mind the test, it would be highly timing dependent and we already have a way of detecting if this work in our usage in Firefox. This LGTM.

@gabrielesvelto gabrielesvelto merged commit 7d76616 into rust-minidump:main Jan 9, 2023
@afranchuk
Copy link
Contributor Author

Even without the clippy fixes? Do you want me to fix those in a separate PR?

The test I was going to write would have been deterministic with some barriers or condition variables, but if you feel that the behavior is sufficiently covered that's all the better for me :)

@gabrielesvelto
Copy link
Contributor

I fixed the clippy issues after merging your PR, I didn't want to waste your time on them given they were trivial. As for the test I thought about it and it's a lot of work for little benefit: it's a scenario we routinely hit in production and we have a dedicated path for handling errors. If it doesn't work as expected we'll see it in production, if it works then the error will be gone and we get more minidumps. So there's no downsides to not having test coverage.

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

Successfully merging this pull request may close these issues.

Don't fail when ptrace::detach() returns an ESRCH error
2 participants