* Bernhard Voelker: > On 5/6/19 9:19 PM, Florian Weimer wrote: >> How would a programmer check that close_stdout has run, to determine >> that stdout and stderr are now invalid, to avoid the memory corruption? > > lib/closeout.c:98: > "Since close_stdout is commonly registered via 'atexit', [...]" > > close_stdout is used right before the process ends, so I don't see > what further actions would follow.
atexit handlers run before ELF destructors (and some C++ destructors). There can also be multiple such handlers. So it's not true that an atexit handler always runs last. Thanks, Florian