public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Edgar Mobile <heideggm@hotmail.com>
To: Ruslan Kabatsayev <b7.10110111@gmail.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Does gdb initialize uninitialized variables?
Date: Tue, 22 Feb 2022 21:30:26 +0000	[thread overview]
Message-ID: <DM8PR16MB43570B4C67A758622E0AA536C73B9@DM8PR16MB4357.namprd16.prod.outlook.com> (raw)
In-Reply-To: <CAHEcG9720WghrUUrb69LOu=ZDg5VjrJmzu2AnetyXjvLBa2t8w@mail.gmail.com>

I tried it as the very first command even before run. Any more ideas? (tx already)

________________________________
From: Ruslan Kabatsayev <b7.10110111@gmail.com>
Sent: Monday, February 21, 2022 5:33 PM
To: Edgar Mobile <heideggm@hotmail.com>
Cc: gdb@sourceware.org <gdb@sourceware.org>
Subject: Re: Does gdb initialize uninitialized variables?

Hi,

On Mon, 21 Feb 2022 at 12:45, Edgar Mobile via Gdb <gdb@sourceware.org> wrote:
>
> Greetings,
>
> I currently try to find a bug that might be caused by uninitialized variables/memory. But it never appears when I use gdb. Does gdb change how memory is initialized in any way, be it on stack or via new/malloc?

Memory-related bugs that don't happen when using GDB but do without
GDB are often caused by GDB disabling ASLR. This is usually useful for
reproducibility of debugging sessions, but may indeed make address
space layout too predictable and fail to reproduce a bug. Try using
the GDB command "set disable-randomization off" (without quotes) to
undo this behavior and thus start your program in a normal,
randomized, environment.

Besides, if your problem is indeed with uninitialized variables, you
might find Valgrind memory checker more useful than a debugger.

>
> Regards

Regards,
Ruslan

  reply	other threads:[~2022-02-22 21:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21  9:44 Edgar Mobile
2022-02-21 17:33 ` Ruslan Kabatsayev
2022-02-22 21:30   ` Edgar Mobile [this message]
2022-02-22 22:20     ` Martin Simmons

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=DM8PR16MB43570B4C67A758622E0AA536C73B9@DM8PR16MB4357.namprd16.prod.outlook.com \
    --to=heideggm@hotmail.com \
    --cc=b7.10110111@gmail.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).