[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why does close_stdout close stdout and stderr?
From: |
Florian Weimer |
Subject: |
Re: Why does close_stdout close stdout and stderr? |
Date: |
Thu, 09 May 2019 08:39:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
* 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
- Re: Why does close_stdout close stdout and stderr?, Florian Weimer, 2019/05/06
- Re: Why does close_stdout close stdout and stderr?, Bernhard Voelker, 2019/05/06
- Re: Why does close_stdout close stdout and stderr?, Florian Weimer, 2019/05/06
- Re: Why does close_stdout close stdout and stderr?, Bernhard Voelker, 2019/05/06
- Re: Why does close_stdout close stdout and stderr?, Florian Weimer, 2019/05/06
- Re: Why does close_stdout close stdout and stderr?, Bernhard Voelker, 2019/05/09
- Re: Why does close_stdout close stdout and stderr?,
Florian Weimer <=
- Re: Why does close_stdout close stdout and stderr?, Bernhard Voelker, 2019/05/09
- Re: Why does close_stdout close stdout and stderr?, Paul Eggert, 2019/05/09
- Re: Why does close_stdout close stdout and stderr?, Kamil Dudka, 2019/05/10
- Re: Why does close_stdout close stdout and stderr?, Florian Weimer, 2019/05/10
- Re: Why does close_stdout close stdout and stderr?, Paul Eggert, 2019/05/12
- Re: Why does close_stdout close stdout and stderr?, Florian Weimer, 2019/05/13
- Re: Why does close_stdout close stdout and stderr?, Paul Eggert, 2019/05/24
- Re: Why does close_stdout close stdout and stderr?, Bruno Haible, 2019/05/25
- Re: Why does close_stdout close stdout and stderr?, Florian Weimer, 2019/05/27
- Re: Why does close_stdout close stdout and stderr?, Bruno Haible, 2019/05/25