Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: Pavel Shevaev <pacha.shevaev@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Trying to spot memory corruption with core dump
Date: Tue, 28 Jul 2009 13:43:00 -0000	[thread overview]
Message-ID: <8ac60eac0907280642h4700d7d5m95204a6e201281da@mail.gmail.com> (raw)
In-Reply-To: <d9c3f61a0907280011u525ba9e3k76f7746659b51784@mail.gmail.com>

On Tue, Jul 28, 2009 at 12:11 AM, Pavel Shevaev<pacha.shevaev@gmail.com> wrote:
>> On Linux/ix86 and x86_64, nothing beats Valgrind (for finding heap corruption).
>
> Oh, forgot to mention this on the very first post. I'm using linux
> x86_64 and I'm aware of Valgrind and I even tried it....the problem is
> it doesn't detect any memory corruption at all and what's even more
> amazing my application doesn't seg.fault under Valgrind even after
> running the whole day :(

With typical VG slow-downs (50x to 100x), you need to run it longer: 3
hours without VG => 50*3/24.0 == 1 week under VG.

> I think it's because Valgrind slows down the
> application considerably and some how the rare edge case when memory
> corruption occurs simply doesn't happen.

Is the application multithreaded?
Does it process a "random" event source?

VG could change timing and make bugs hide; that's not unheard of.
You could try setting MALLOC_CHECK_=2 in the environment (see 'info
libc'), or linking the application with '-lmcheck'.

Finally, does your application handle async signals?
If so, does signal handler call anything async-signal unsafe? That is
one common source of "random" heap corruption.

Cheers,
-- 
Paul Pluzhnikov


  reply	other threads:[~2009-07-28 13:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28  6:44 Pavel Shevaev
2009-07-28  6:58 ` Paul Pluzhnikov
2009-07-28  7:12   ` Pavel Shevaev
2009-07-28 13:43     ` Paul Pluzhnikov [this message]
2009-07-28 16:55       ` Pavel Shevaev
2009-07-28 17:32         ` Michael Snyder
2009-07-28 21:51         ` Samuel Bronson

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=8ac60eac0907280642h4700d7d5m95204a6e201281da@mail.gmail.com \
    --to=ppluzhnikov@google.com \
    --cc=gdb@sourceware.org \
    --cc=pacha.shevaev@gmail.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