Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Re the last wish, isn't that exactly what ulimit is for?


On Linux, yes, but this was Windows-specific code and Windows has no equivalent mechanism to ulimits.


There are job objects which are similar to Linux cgroups, including the ability to set a limit on the number of processes. But I'm not sure if that limit will be tripped in this case or not because the child processes have exited, whereas the job object parameter is specifically called LIMIT_ACTIVE_PROCESS

https://learn.microsoft.com/en-us/windows/win32/procthread/j...

https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns...


OpenProcess retrieves a handle to an existing process rather than creating a process so it won't be governed by JOB_OBJECT_LIMIT_ACTIVE_PROCESS, the bug here is that it's leaking handles, not processes.


Ah yes, in that case the relevant limit would be one on total handles, which doesn't seem to exist.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: