Uh oh!
There was an error while loading. Please reload this page.
std.posix: Added error message 'ProcessNotFound' for reading and writing in a Linux process - #21430
Conversation
chrboesch
commented
Sep 16, 2024
I can't complete this PR due to the complexity of the dependencies. Since I can't test on MacOS or Windows and the error message only says "test-fmt transitive error", I don't know how to fix this. |
alexrp
commented
Sep 16, 2024
It means you have code formatting violations; run |
| /// not hold the required rights to read from it. | ||
| AccessDenied, | ||
| // This error occurs in Linux if the process to be read from |
There was a problem hiding this comment.
These should be doc comments (/// instead of //)
linusg
left a comment
There was a problem hiding this comment.
This handles ENOENT aka errno 2 aka error.FileNotFound, the linked issue is about ESRCH (errno 3).
chrboesch
commented
Sep 18, 2024
Because Linux returns the ENOENT error for a process (aka file) that no longer exists when trying to read or write to it. |
linusg
commented
Sep 18, 2024
Then it would be good to note that in the original issue so the author knows they're mistaken or can clarify the situation in which |
chrboesch
commented
Sep 18, 2024
alexrp
commented
Sep 24, 2024
Actually, I'm not so confident in this change on second thought, given this: giampaolo/psutil@22651a6#diff-d969f5377d3dc82ba7501f4c9f6d6510e1240df2debdca7c726a9ff37fde7af7R1340-R1349 I think this behavior needs to be verified manually. |
chrboesch
commented
Sep 24, 2024
What do you mean exactly? |
alexrp
commented
Sep 25, 2024
As in, write a test program that does:
|
chrboesch
commented
Sep 25, 2024
I did this manually on two different Linux systems (Arch, Gentoo) to check which error I get. A test program is difficult because the PIDs change every time and in principle two programs have to start, which tell each other the PID they currently have. Would be feasible. Only why? I think the result will be the same as with my tests. And if that changes in Linux (in a future kernel), we have to make adjustments anyway. |
alexrp
commented
Sep 25, 2024
The commit I linked above claims that the returned error for |
chrboesch
commented
Sep 26, 2024
I also assumed that an ESRCH error would occur, but I received ENOENT. I then analyzed the kernel source code in 'fs/proc/fd.c', and in the function 'proc_readfd_common', only ENOENT is used. No idea what the Python folks are doing, but ESRCH is definitely not returned on an x64 system. staticintproc_readfd_common(structfile*file, structdir_context*ctx,
instantiate_tinstantiate)
{
structtask_struct*p=get_proc_task(file_inode(file));
unsigned intfd;
if (!p)
return-ENOENT;
... |
mlugg
commented
Sep 26, 2024
Please don't post LLM-generated content on the issue tracker. A glorified text prediction engine does not provide any useful perspective or information. |
chrboesch
commented
Sep 26, 2024
No prob, I deleted it. |
process. This error occurs if the process to be read from or written to no longer exists. Fixesziglang#19875
This error occurs if the process to be read from or written to no longer exists.
Fixes#19875