Bug 9854 - glibc opens up new tty to print *** %n in writable segment detected ***
Summary: glibc opens up new tty to print *** %n in writable segment detected ***
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.8
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-17 00:33 UTC by Martin Walch
Modified: 2014-07-01 20:53 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Walch 2009-02-17 00:33:09 UTC
I am a user of Gentoo Linux and I found some warnings on my screen that I could
not redirect like stdout or stderr. They appear during execution of configure
scripts, like the ones from coreutils or m4 and are caused by glibc. So I wrote
a bug report on the Gentoo bug tracker. But the guys there say that everything
is as it should be:

http://bugs.gentoo.org/show_bug.cgi?id=257279

But I do not think, that this is acceptable. Next, I wrote to the bug-autoconf
mailing list:

http://lists.gnu.org/archive/html/bug-autoconf/2009-02/msg00006.html

and was forwarded to bug-gnulib:

http://lists.gnu.org/archive/html/bug-gnulib/2009-02/msg00103.html

and from there I was sent here:

http://lists.gnu.org/archive/html/bug-gnulib/2009-02/msg00106.html
Comment 1 Ulrich Drepper 2009-02-17 01:42:15 UTC
The message should not be ignored and the code in glibc works hard to always get
the message out.  It works as it should.
Comment 2 Martin Walch 2009-02-17 08:38:30 UTC
IMO the exact opposite is true. The message can not be logged and will be
discarded. It will be ignored, because it will not even be recognized.

It is always possible to ignore a warning, no matter how it is announced. But
when caring about important warnings, they are expected on stderr. I personally
prefer an operating system that cooperates and does not force me to keep a
terminal open.
Comment 3 Kees Cook 2009-09-11 20:02:58 UTC
glibc attempts to write to the controlling terminal, in the hopes that it will
be noticed at the highest possible level.  Especially since a process may have
closed its stderr already.

To explicitly disable this and try to write to fd 2, you can set the environment
variable LIBC_FATAL_STDERR_=1 (yes, there is a trailing underscore in the
variable name).