From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18798 invoked by alias); 27 Feb 2008 11:59:28 -0000 Received: (qmail 18774 invoked by uid 22791); 27 Feb 2008 11:59:26 -0000 X-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_44,J_CHICKENPOX_84 X-Spam-Check-By: sourceware.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (83.160.170.119) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Feb 2008 11:59:09 +0000 Received: from dijkstra.wildebeest.org ([192.168.1.29]) by gnu.wildebeest.org with esmtp (Exim 4.63) (envelope-from ) id 1JUKwC-00052l-2h; Wed, 27 Feb 2008 12:59:04 +0100 Subject: Re: [SCM] master: Switch to frysk.sys.ptrace. From: Mark Wielaard To: frysk@sourceware.org Cc: Andrew Cagney In-Reply-To: <1202892451.3421.9.camel@dijkstra.wildebeest.org> References: <20080212185049.22237.qmail@sourceware.org> <1202892451.3421.9.camel@dijkstra.wildebeest.org> Content-Type: text/plain Date: Wed, 27 Feb 2008 11:59:00 -0000 Message-Id: <1204113543.3615.22.camel@dijkstra.wildebeest.org> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-1.fc8) Content-Transfer-Encoding: 7bit X-Spam-Score: -4.4 (----) X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q1/txt/msg00082.txt.bz2 Hi Andrew, On Wed, 2008-02-13 at 09:47 +0100, Mark Wielaard wrote: > On Tue, 2008-02-12 at 18:50 +0000, cagney@sourceware.org wrote: > > - private int peek(long index, byte[] bytes, int offset, int length) > > - { > > - if (mem != null) > > - { > > - try > > - { > > - return mem.pread(index, bytes, offset, length); > > - } > > - catch (Errno e) > > - { > > - // try again through address space. > > + private void transfer(long index, byte[] bytes, int offset, int length, > > + boolean write) { > > + if (mem != null && !write) { > > + try { > > + mem.pread(index, bytes, offset, length); > > + return; > > + } catch (Errno e) { > > + // Give up on mem; and fall back to ptrace. This > > + // can happen when /proc isn't mounted, or when a > > + // process is terminating and the kernel scrubs > > + // the /proc entry before its time. > > + mem = null; > > } > > } > > Are you sure this change is right? The comment is right about those 2 > reasons for pread() possibly failing. But I don't believe that is the > only case it can happen. Previously when a read occurred that failed, > possibly because following a pointer in the inferior that was NULL or > not yet initialized that would just cause a error reading from that > particular (uninitialized) memory location. But now whenever that occurs > once for an inferior you blow away mem so pread() can never be used > anymore and we always fall back to having to do single peeks and pokes > through the ptrace address space. Did you have time to investigate this? If not, shall we revert it to the original implementation till you do have time? Thanks, Mark