PRecord sets memory even when it says it did not

Doug Evans dje@google.com
Mon Sep 14 21:08:00 GMT 2009


On Mon, Sep 14, 2009 at 1:35 PM, Pedro Alves <pedro@codesourcery.com> wrote:
> There's one wrinkly corner case not being handled.  If the to_xfer_partial
> 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.  This is fine if we assume that errors
> are only thrown before attempting any transfer at all, but that is not
> reality.  E.g., when xfering [1000, 2000) in a single go, that may
> fail half way, say, at 1500 with a hard thrown error.  Only 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.  Not
> 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.



More information about the Gdb-patches mailing list