Breakpoint loss under low memory conditions

dwk dwks42@gmail.com
Tue Nov 20 16:16:00 GMT 2018


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
>



More information about the Gdb mailing list