From: Jonas Maebe <jonas.maebe@elis.ugent.be>
To: gdb@sourceware.org
Subject: Re: program does not crash when attached to gdbserver
Date: Sat, 13 Jun 2009 15:26:00 -0000 [thread overview]
Message-ID: <43312B01-A06A-4144-A040-9A3B40252E69@elis.ugent.be> (raw)
In-Reply-To: <C7280F67-E7A0-480F-8A8C-A1C063513EC0@cyclaero.com>
On 13 Jun 2009, at 15:53, Dr. Rolf Jansen wrote:
> Am 13.06.2009 um 05:50 schrieb Jonas Maebe:
>
>>
>> In general, this is a feature of the compiler and/or run time,
>> rather than of the debugger (the debugger cannot know how the
>> memory manager of your run time works, so unless you exclusively
>> use OS or OS-supplied library functions, it cannot scramble
>> anything).
>
> I can understand this, and as a matter of fact I would have expected
> that the debugger does not interact with the memory management, my
> problem is that it acts somehow on mm and the runtime. It would
> already be of help for me if somebody could point me to some
> possible areas of interaction, which could make up for the above
> mentioned different behaviour of running the same binary with and
> without gdbserver being attached.
I was only pointing out why gdb does not include memory scrambling
functionality similar to macsbug.
It is true that running a program under a debugger sometimes changes
its behaviour, particularly when uninitialised memory is involved.
Such problems are often called "heisenbugs".
>> E.g., in case of the Free Pascal Compiler, there are the -gttt
>> (scramble all local variables on function entry) and -gh (use the
>> heaptrc unit, which, a.o., scrambles all freed memory) options.
>>
>> For GCC, you can have a look which of these work on your target
>> platform: http://en.wikipedia.org/wiki/Memory_debugger
>
> I experimented a bit with memwatch, to no more avail than finding
> some freeing-NULL occasions. I would not have bothered you with my
> case, if I would still have own ideas to try. Anyway, I will have a
> look to the other options mentioned at the wiki page.
At least some of those should have options to fill freed and allocated
memory with random data. You may also want to try this one: http://support.microsoft.com/kb/286470
Jonas
next prev parent reply other threads:[~2009-06-13 15:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 22:55 Dr. Rolf Jansen
2009-06-13 8:50 ` Jonas Maebe
2009-06-13 13:54 ` Dr. Rolf Jansen
2009-06-13 15:26 ` Jonas Maebe [this message]
2009-06-13 18:02 ` Dr. Rolf Jansen
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=43312B01-A06A-4144-A040-9A3B40252E69@elis.ugent.be \
--to=jonas.maebe@elis.ugent.be \
--cc=gdb@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