mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: musl@lists.openwall.com
Subject: Re: [RFC PATCH] Allow annotating calloc for Valgrind
Date: Sun, 2 Jul 2017 16:55:08 +0300 (MSK)	[thread overview]
Message-ID: <alpine.LNX.2.20.13.1707021630430.18055@monopod.intra.ispras.ru> (raw)
In-Reply-To: <20170629235624.GI1627@brightrain.aerifal.cx>

On Thu, 29 Jun 2017, Rich Felker wrote:
> It reached the point of an faq item on irc; perhaps it was never
> discussed on the ml.

I feel a quick reminder of what was discussed would be very nice.

> If that happens, it's just a valgrind bug. It can see the memory was
> returned by calloc and therefore the contents are defined. But maybe
> before discussing this further we need to clarify what the actual
> scenario is.

Alright. As far as I can tell, everyone hits this (only) with static
linking. Valgrind core *does* have a concept of a symbol table being
distinct from dynamic symbol table (info from symtab is successfully
used for backtracing for example), so in principle Memcheck could use
just the .symtab when running unstripped static executables.

Unfortunately, historically the implementation of Memcheck relies
entirely on dynamic linking to intercept allocation functions. As a
result, Memcheck's functionality on static executables degrades
significantly (it can still find a subset of uninit access errors).

I guess the proper fix - wiring up .symtab-based interception - might
require more time than anyone was prepared to volunteer.

I think at the moment client requests are the only straightforward way
to use Memcheck fully with statically-linked programs.  But for full
functionality, people would need extra requests informing Memcheck
about the effects of static malloc & free. Where would such a patch
belong?

Alexander


  reply	other threads:[~2017-07-02 13:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 22:56 Alexander Monakov
2017-06-29 23:20 ` Rich Felker
2017-06-29 23:42   ` Alexander Monakov
2017-06-29 23:56     ` Rich Felker
2017-07-02 13:55       ` Alexander Monakov [this message]
2017-07-02 14:35         ` Rich Felker
2017-07-02 16:16           ` Alexander Monakov
2017-07-02 16:31             ` Rich Felker

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=alpine.LNX.2.20.13.1707021630430.18055@monopod.intra.ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).