bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Kamil Dudka <kdudka@redhat.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	bug-gnulib@gnu.org, Jeff Layton <jlayton@redhat.com>,
	Bernhard Voelker <mail@bernhard-voelker.de>,
	NeilBrown <neilb@suse.com>, Eric Blake <eblake@redhat.com>
Subject: Re: Why does close_stdout close stdout and stderr?
Date: Sun, 12 May 2019 18:09:59 -0700	[thread overview]
Message-ID: <c565fd85-dcc7-f09f-5548-faa1073fbee7@cs.ucla.edu> (raw)
In-Reply-To: <19715489.IPbOx59hZO@kdudka-nb>

Kamil Dudka wrote:

>> OK, but this shouldn't be a problem with any applications currently
>> using close_stdout. At least, none of the applications I know about.
> 
> How would you know if they did?

The usual way: ordinary users would be complaining. By "ordinary users" I mean 
users other than developers who are employing unusual compiler options, 
LD_PRELOAD settings, etc. for testing.
> As long as you link libraries dynamically, any of the directly or indirectly
> linked libraries can introduce an ELF destructor or atexit() handler anytime,

I don't see any way around this problem in general with the closeout module's 
current API, because when it discovers an I/O error it calls _exit, and _exit 
also clashes with that kind of cleanup handling.

If we want Coreutils and similar programs to be robust even for developers with 
unusual configurations for testing, I expect we'll need to change the programs 
to not use the closeout module at all. This would complicate these programs, 
since we'd need to check every way that every stdin-reading or stdout- or 
stderr-writing program can exit normally, and modify the affected programs to 
check the relevant I/O streams just before the normal exit occurs.


  parent reply	other threads:[~2019-05-13  1:10 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 19:45 Why does close_stdout close stdout and stderr? Florian Weimer
2019-04-29 19:49 ` Eric Blake
2019-04-29 20:26   ` Florian Weimer
2019-05-06 12:05     ` Florian Weimer
2019-05-06 14:56       ` Bernhard Voelker
2019-05-06 15:47         ` Florian Weimer
2019-05-06 19:14           ` Bernhard Voelker
2019-05-06 19:19             ` Florian Weimer
2019-05-09  6:20               ` Bernhard Voelker
2019-05-09  6:39                 ` Florian Weimer
2019-05-09  9:49                   ` Bernhard Voelker
2019-05-09 22:17                   ` Paul Eggert
2019-05-10  7:28                     ` Kamil Dudka
2019-05-10  7:31                       ` Florian Weimer
2019-05-13  1:09                       ` Paul Eggert [this message]
2019-05-13  7:00                         ` Florian Weimer
2019-05-25  1:41                           ` Paul Eggert
2019-05-25 10:58                             ` Bruno Haible
2019-05-27 11:56                             ` Florian Weimer
2019-05-25 11:24                           ` Bruno Haible
2019-05-25 19:23                             ` Paul Eggert
2019-05-27 12:00                             ` Florian Weimer
2019-05-27 21:13                               ` Bruno Haible
2019-05-06 18:53       ` Paul Eggert
2019-05-06 19:02         ` Jeff Layton
2019-05-06 22:32       ` Bruno Haible
2019-05-07  9:44         ` Assaf Gordon
2019-05-07  9:49           ` Assaf Gordon
2019-05-07 11:28           ` Bruno Haible
2019-05-08  0:43             ` NeilBrown
2019-05-08 11:00               ` Florian Weimer
2019-05-09  4:42                 ` Paul Eggert
2019-05-09  5:01                   ` Florian Weimer
2019-05-09  6:27                   ` NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c565fd85-dcc7-f09f-5548-faa1073fbee7@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=bug-gnulib@gnu.org \
    --cc=eblake@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=kdudka@redhat.com \
    --cc=mail@bernhard-voelker.de \
    --cc=neilb@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).