Re:Fork() without exec() is dangerous in large programs (2016)
by monocasa on Tuesday June 14, 2022 @12:23PM
(#31741696)
They still share an address space until exec replaces it for one of them. Particularly awful is that they share the same mutable stack which is a pathway that only leads to the inner circle of hell.
[ Parent
| on HN ]
Re:Fork() without exec() is dangerous in large programs (2016)
by stefan_ on Tuesday June 14, 2022 @02:38PM
(#31743926)
Assuming you call exec, of course. To not call exec after vfork is not an option; one of the many ways the fork family of functions are fundamentally broken.
Re:Fork() without exec() is dangerous in large programs (2016)
by monocasa on Tuesday June 14, 2022 @03:13PM
(#31744526)
Well, without undefined behavior you can also call _exit(), continue within the same function, and receive conforming signals. Unfortunately this isn't always spelled out and there's code out there that definitely does other work invoking undefined behavior.