* Breakpoint loss under low memory conditions
@ 2018-11-20 7:31 Stoll, Walter
2018-11-20 16:16 ` dwk
0 siblings, 1 reply; 2+ messages in thread
From: Stoll, Walter @ 2018-11-20 7:31 UTC (permalink / raw)
To: gdb
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Breakpoint loss under low memory conditions
2018-11-20 7:31 Breakpoint loss under low memory conditions Stoll, Walter
@ 2018-11-20 16:16 ` dwk
0 siblings, 0 replies; 2+ messages in thread
From: dwk @ 2018-11-20 16:16 UTC (permalink / raw)
To: Stoll, Walter; +Cc: GDB
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-20 16:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20 7:31 Breakpoint loss under low memory conditions Stoll, Walter
2018-11-20 16:16 ` dwk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox