rust-minidump / minidump-writer

Rust rewrite of breakpad's minidump_writer
MIT License
68 stars 17 forks source link

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

Closed afranchuk closed 1 year ago

afranchuk commented 1 year ago

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

Closes #29.

afranchuk commented 1 year ago

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 commented 1 year ago

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!

afranchuk commented 1 year ago

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 commented 1 year ago

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.