|
|
Subscribe / Log in / New account

Process ids again

Process ids again

Posted Jun 6, 2025 20:42 UTC (Fri) by warrax (subscriber, #103205)
In reply to: Process ids again by Cyberax
Parent article: Slowing the flow of core-dump-related CVEs

If you ever do anything other than copy/paste PIDs when using the command line (which I assume you mean by UI), I'd be a bit worried. Actually... I think it'd actually be better if it was hard-enough-to-type so that it MUST be copy/pasted. Killing a mistyped PID *should* do nothing.


to post comments

Process ids again

Posted Jun 6, 2025 20:43 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link] (3 responses)

I absolutely do stuff other than act as a copypaste bot. Including looking at logs, and correlating things across multiple sources. I almost never need to actually kill processes by ID.

Long IDs make that harder.

Process ids again

Posted Jun 7, 2025 5:42 UTC (Sat) by epa (subscriber, #39769) [Link] (2 responses)

On the other hand, right now if you are looking for a process id in a log file, you don’t have any guarantee that it’s the same process, since pids can be reused. Making them unique has to be better, even if it means the number might be longer. (You’d only get the big numbers on a long-running system that has forked vast numbers of processes, and in that case I suggest you’d particularly benefit from not having a number reused.)

Even in ordinary command line use like “see a process id in top and then kill it” there is a race condition and some danger if pids are not unique.

Process ids again

Posted Jun 7, 2025 5:53 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link]

> On the other hand, right now if you are looking for a process id in a log file, you don’t have any guarantee that it’s the same process

That's true, but in practice infrequent, outside of deliberate attacks.

Process ids again

Posted Jun 7, 2025 6:51 UTC (Sat) by iabervon (subscriber, #722) [Link]

I often use them to identify the lines from some process that are interspersed with lines from other related processes. Occasionally, the same PID is a different process later, but only after the last line that is from the same process. It's also useful in REST API server logs: different lines from serving the same request have the same PID, but even if there isn't any PID reuse, the same process generally goes on to serve another request, but not until it's done with the first one.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds