From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91861 invoked by alias); 20 Nov 2018 16:16:56 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 91722 invoked by uid 89); 20 Nov 2018 16:16:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=BAYES_40,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=walter, gentlemen, Walter, ladies X-HELO: mail-qt1-f174.google.com Received: from mail-qt1-f174.google.com (HELO mail-qt1-f174.google.com) (209.85.160.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Nov 2018 16:16:53 +0000 Received: by mail-qt1-f174.google.com with SMTP id n21so585728qtl.6 for ; Tue, 20 Nov 2018 08:16:53 -0800 (PST) MIME-Version: 1.0 References: <25100483E4CD1F4087B0A40EBF04FFBD1D5BE7B7@DENBGAT9EH3MSX.ww902.siemens.net> In-Reply-To: <25100483E4CD1F4087B0A40EBF04FFBD1D5BE7B7@DENBGAT9EH3MSX.ww902.siemens.net> From: dwk Date: Tue, 20 Nov 2018 16:16:00 -0000 Message-ID: Subject: Re: Breakpoint loss under low memory conditions To: "Stoll, Walter" Cc: GDB Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-11/txt/msg00017.txt.bz2 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 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 >