public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "carlos at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/26022] valgrind gives me error when fwprintf in stderr
Date: Fri, 29 May 2020 20:09:52 +0000	[thread overview]
Message-ID: <bug-26022-131-62BGTJH8t7@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26022-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=26022

--- Comment #3 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Mark Wielaard from comment #2)
> (In reply to Carlos O'Donell from comment #1)
> > I've filed a Valgrind bug here:
> > https://bugs.kde.org/show_bug.cgi?id=421931
> > 
> > Please feel free to follow up there if you think it needs an update or you
> > want to give a +1 regarding your use case.
> > 
> > I'm marking this RESOLVED/INVALID for glibc.
> 
> As discussed in that bug, lets reconsider if this is something that can be
> cleaned up or clarified in glibc. valgrind itself doesn't use streams, or
> even link against glibc itself. When valgrind "calls" __libc_freeres the
> user process as already exitted, no other code/threads that could call into
> glibc will run during or after the call to __libc_freeres. Are there any
> other users of __libc_freeres that might not make those guarantees?

The problem is that valgrind is unique. No other library that uses
__libc_freeres, including glibc's own mtrace, goes to as much lengths as
valgrind does to get out of the way of the runtime. It is expected that
__libc_freeres can be called from a destructor, and so we may have threads
still writing to unbuffered streams, and we don't want to free those streams if
they have internal data (there might be a distinct bug there). Therefore
valgrind users whose application touches stderr may always see a leak in
stderr, and it's up to valgrind to supress that or not.

In the meantime I'm going to try track down why stderr, unbuffered as it is,
allocates anything, which we think might actually be a bug. Even if we fix the
bug, valgrind is left with many old glibcs before the new glibc makes it out
into production.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2020-05-29 20:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22  7:45 [Bug libc/26022] New: " daffra.claudio at gmail dot com
2020-05-22 20:07 ` [Bug libc/26022] " carlos at redhat dot com
2020-05-29 19:40 ` mark at klomp dot org
2020-05-29 20:09 ` carlos at redhat dot com [this message]
2020-06-04  9:45 ` daffra.claudio at gmail dot com
2020-06-04 12:19 ` mark at klomp dot org
2020-06-04 16:58 ` daffra.claudio at gmail dot com

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

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

  git send-email \
    --in-reply-to=bug-26022-131-62BGTJH8t7@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /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).