benfred / remoteprocess

Cross platform process information in Rust
MIT License
56 stars 29 forks source link

Fix `/proc/{pid}/stat` parsing: Allow thread names to contain ) #68

Closed wmanley closed 1 year ago

wmanley commented 1 year ago

by finding the terminating ) by looking for the last one on the line, rather than the first one.

See https://stackoverflow.com/a/29887040/65031

We name our Python threads after the Thread's target function. The thread named Thre.(<lambda>) was causing py-spy to fail with: "Error: Failed to parse /proc/83/stat"

benfred commented 1 year ago

thanks for the fix! it looks good to me