Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: dwk <dwks42@gmail.com>
To: "Stoll, Walter" <walter.stoll@siemens.com>
Cc: GDB <gdb@sourceware.org>
Subject: Re: Breakpoint loss under low memory conditions
Date: Tue, 20 Nov 2018 16:16:00 -0000	[thread overview]
Message-ID: <CAPkwjGtqJ2d2jZ9aJXCY72U6Nhw21YEpKbxGWgHzEGA9ybwutw@mail.gmail.com> (raw)
In-Reply-To: <25100483E4CD1F4087B0A40EBF04FFBD1D5BE7B7@DENBGAT9EH3MSX.ww902.siemens.net>

When gdb sets a breakpoint on an executable page by writing a word through
ptrace, that page becomes a private+anonymous copy of the original shared
mapping. It's treated like any other anonymous mapping and will be paged
out and in separately from the original shared executable pages. So the
scenario you are concerned about is not an issue. For more info:

https://yarchive.net/comp/linux/ptrace_mmap.html


--dwk.

On Tue, Nov 20, 2018, 2:31 AM Stoll, Walter <walter.stoll@siemens.com wrote:

> Ladies and Gentlemen
>
> Under low memory conditions, the Linux kernel may evict pages that contain
> executable code sections. If such a page was modified by a breakpoint, then
> the breakpoint will get lost when the page is finally faulted in. Is this a
> scenario that can happen in reality or does gdb and/or the kernel provide
> some means which prevent this from happening ?
>
> Regards
> Walter Stoll
>


      reply	other threads:[~2018-11-20 16:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20  7:31 Stoll, Walter
2018-11-20 16:16 ` dwk [this message]

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=CAPkwjGtqJ2d2jZ9aJXCY72U6Nhw21YEpKbxGWgHzEGA9ybwutw@mail.gmail.com \
    --to=dwks42@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=walter.stoll@siemens.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