bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does close_stdout close stdout and stderr?


From: Bernhard Voelker
Subject: Re: Why does close_stdout close stdout and stderr?
Date: Thu, 9 May 2019 08:20:43 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

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.

It seems to me that you're trying to prevent programming errors.
So even the programmer knows his/her code, or maybe he can try
some static code analyzers to find this issue.
Is there a recent case which fell into this (quite obvious) trap?

Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]