diff options
| author | babenko <[email protected]> | 2026-04-20 10:53:22 +0300 |
|---|---|---|
| committer | babenko <[email protected]> | 2026-04-20 11:33:22 +0300 |
| commit | a40ccff37f13b1490b786ce883357a134b2e0c97 (patch) | |
| tree | 0fffff1049457443525d918aaef23f8d3862c9a9 /library/cpp/yt/string/string.cpp | |
| parent | f97aaa37fb4741508a520a1dfed1d6d65a9275e6 (diff) | |
Fix /proc/PID/stat parsing broken by spaces in comm field
Field 2 of /proc/PID/stat (the process name) is wrapped in parentheses by
the kernel and may contain spaces and parentheses. Splitting the whole line
by spaces shifted all subsequent field indices when the comm field contained
spaces, causing startstack to be read from the wrong position.
Fixed by finding the last ')' and splitting only the portion of the line
after it. The field index is adjusted accordingly (field 28 = index 25 in
the trimmed string starting from field 3).
commit_hash:cddde18cff0a89a706dcf78286a8e36972dcb82d
Diffstat (limited to 'library/cpp/yt/string/string.cpp')
0 files changed, 0 insertions, 0 deletions
