From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28563 invoked by alias); 14 Sep 2009 21:08:09 -0000 Received: (qmail 28550 invoked by uid 22791); 14 Sep 2009 21:08:08 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Sep 2009 21:08:02 +0000 Received: from zps78.corp.google.com (zps78.corp.google.com [172.25.146.78]) by smtp-out.google.com with ESMTP id n8EL81oN030950; Mon, 14 Sep 2009 14:08:01 -0700 Received: from ywh2 (ywh2.prod.google.com [10.192.8.2]) by zps78.corp.google.com with ESMTP id n8EL7Zfi002700; Mon, 14 Sep 2009 14:07:58 -0700 Received: by ywh2 with SMTP id 2so4750930ywh.27 for ; Mon, 14 Sep 2009 14:07:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.59.4 with SMTP id h4mr10880549yba.299.1252962476532; Mon, 14 Sep 2009 14:07:56 -0700 (PDT) In-Reply-To: <200909142135.58989.pedro@codesourcery.com> References: <200909141936.10390.pedro@codesourcery.com> <200909142135.58989.pedro@codesourcery.com> Date: Mon, 14 Sep 2009 21:08:00 -0000 Message-ID: Subject: Re: PRecord sets memory even when it says it did not From: Doug Evans To: Pedro Alves Cc: Michael Snyder , Marc Khouzam , "gdb@sourceware.org" , Greg Law , Hui Zhu , gdb-patches ml Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00461.txt.bz2 On Mon, Sep 14, 2009 at 1:35 PM, Pedro Alves wrote: > There's one wrinkly corner case not being handled. =A0If the to_xfer_part= ial > routine throws an error, say a ptrace error of some kind (usually > perror_with_name), the ops target may still have succeeded in writing a > part of that partial transfer, but, the matching caches lines aren't > being invalidated/committed. =A0This is fine if we assume that errors > are only thrown before attempting any transfer at all, but that is not > reality. =A0E.g., when xfering [1000, 2000) in a single go, that may > fail half way, say, at 1500 with a hard thrown error. =A0Only thing 100% > safe to in these cases is to just flush the whole cache area that was > attempted to be written, or perhaps simpler, the whole cache. =A0Not > something you'd see hapenning every day, but still something > to consider at some point. I would have thought that this case would be handled by returning the amount actually written instead of throwing an error (and that not doing so is a bug, regardless of the needs of dcache). A single ptrace call won't fail leaving behind a partial write, but I can imagine a sequence of ptrace writes ultimately failing.