From tlumley at u.washington.edu  Mon Mar 19 16:14:05 2007
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Mon, 19 Mar 2007 08:14:05 -0700 (PDT)
Subject: [Rd] Invalidating inaccessible SEXP?
In-Reply-To: <6phveh1w2h8.fsf@gopher4.fhcrc.org>
References: <6phveh1w2h8.fsf@gopher4.fhcrc.org>
Message-ID: <Pine.LNX.4.64.0703190810310.17682@homer22.u.washington.edu>

On Fri, 16 Mar 2007, Martin Morgan wrote:

> Is there a (C or R) function to invalidate the relevant parts of SEXP
> / data that are inaccessible? My problem is in tracking down
> protection and other memory mismanagement bugs, where I have to rely
> on luck to invalidate or overwrite data to trigger a detectable
> error. This makes it hard to track down a bug (it sometimes doesn't
> occur), or to know that a patch fixes the problem.
>

Under Valgrind when R is compiled  --with-valgrind-instrumentation=2 the 
code walks the list of newly freed SEXPs and marks them as inaccessible 
(which is one reason why it is so slow).

I don't know of any other facilities to do what you want.

 	-thomas



[Rd] Invalidating inaccessible SEXP?
Thomas Lumley