[[!meta copyright="Copyright © 2012, 2013, 2014 Free Software Foundation, Inc."]] [[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable id="license" text="Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled [[GNU Free Documentation License|/fdl]]."]]"""]] The *proc server* (or, *process server*) implements some aspects of [[Unix]] processes. It is stated by `/hurd/init`. # "Unusual" PIDs [[!tag open_issue_hurd]] ## IRC, freenode, #hurd, 2012-08-10 too bad the proc server has pid 0 top & co won't show it ## IRC, OFTC, #debian-hurd, 2012-09-18 youpi: did you see https://enc.com.au/2012/09/careful-with-pids/' ? nope ## IRC, OFTC, #debian-hurd, 2013-06-23 I've got this idea about the pid 1 issue you mentioned can't we just make init pid 1? I mean the mapping is rather arbitrary, we could make our init pid 2 or something and start sysvs init as pid 1 not totally sure it is that arbitrary up to the first 4-5 pids y is that? at least i see in hurd's code that /hurd/init is assumed as pid=1 hurds init that has to stick around for the fs translator sync? hurd's init does the basic server startup iirc it also takes care of shutdown/reboot that's what I meant and if it wouldn't have to stick around for the translator sync it could just exec sysvinit I just think it's easier to patch hurd than to remove the assumption that init is pid 1 from sysvinit ## IRC, freenode, #hurd, 2013-09-13 teythoon: also, as a feature request, i'd like the proc server not to have pid 0, if you have any time to do that so it appears in top and friends braunr: noted, that should be easy not using 0 is probably a good thing, many things use pid 0 as something special ## IRC, freenode, #hurd, 2013-09-25 so nice to finally see proc in top :) # Process Discovery ## IRC, freenode, #hurd, 2013-08-26 < teythoon> somewhat related, I do not like the way the proc server just creates processes for new mach tasks it discovers < teythoon> that does not play well with subhurds for example < braunr> teythoon: i agree with you on proc process-to-task mapping < braunr> that's something i intend to completely rework on propel < braunr> in a way similar to how pid namespaces work on linux # PID "Races" ## IRC, freenode, #hurd, 2014-01-26 Does Hurd have anything that generally solves PID races? what kind of race are you thinking about? I'm not sure, but I guess keeping a reference to a task port will prevent the proc server from recycling the corresponding pid Yep. How does the Hurd avoid the obvious denial-of-service attack that results? well quotas would probably be enough that's not a new issue :) Fair enough. Returning to the POSIX-y world after a few year stint over in NT-land, it's infuriating that it's still not possible to write a reliable killall(1) under Linux or the BSDs. I'm glad Hurd solves the problem. :-) but it doesn't how can you write a reliable killall ? so keeping a reference to the task port is not enough? i'm not sure first i'd like quotemstr to clearly define the reliability problem of killall braunr: The possibility that a PID might be used between the time you decide to kill it and the time you actually kill it. well, it would have to wrap around for that braunr: So? It's possible. i guess that's what you refer to ok well yes, it's possible to easily create a routine that atomically increases the number of references on a task/process when looking it up preventing its removal from the list of processes reported by the proc server Like OpenProcess? :-) Would this reference count be automatically decremented if the task owning the reference is killed? it would clearly not be a "posixy killall" then, but i suppose we don't care about that at all no Oh. destroying an object doesn't remove its references So it's possible to leak the reference and prevent reuse of that PID forever. hardly for that, killall would have to run a long time braunr: No, I'm talking about our hypothetical killall itself being killed after taking out a reference on another process, but before releasing it but a malicious killall could when a task is destroyed, its capability space is destroyed too removing all the references it previously had Ah, I see. the leaks we have occur in servers which sometimes act as clients to other servers and run forever # Crashes due to rpctrace ## IRC, freenode, #hurd, 2014-02-18 something is wrong in the proc server rpctrace is often causing it to crash ..