From ripley at stats.ox.ac.uk  Mon Nov 17 06:53:15 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon, 17 Nov 2008 05:53:15 +0000 (GMT)
Subject: [Rd] Diagnosing Crashes on garbage collection
In-Reply-To: <Pine.LNX.4.64.0811161658320.19506@homer23.u.washington.edu>
References: <4d17c3500811161639t6619ba24p158de02b5a96b6a6@mail.gmail.com>
	<Pine.LNX.4.64.0811161658320.19506@homer23.u.washington.edu>
Message-ID: <alpine.LFD.2.00.0811170550590.23462@gannet.stats.ox.ac.uk>

On Sun, 16 Nov 2008, Thomas Lumley wrote:

> On Sun, 16 Nov 2008, Andrew Redd wrote:
>
>> I'm having problems with an access violation error on some compiled code
>> that I'm writing and I was hoping that some one had insights as to what
>> might be causing the access violation and possibly how to remedy it.
>
> If you are using (or can use) Linux, then valgrind is an excellent tool for 
> this. There's some documentation in 'Writing R Extensions'. Valgrind runs 
> your code in a virtual machine and tracks all memory accesses, so it often 
> will even find bugs in C code that are hard to reproduce.

And if it is R's garbage collection that is the issue, using 
gctorture(TRUE) (with valgrind if possible) will provoke the problem at 
the earlist opportunity.

There is a section in 'Writing R Extensions' on that too.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] Diagnosing Crashes on garbage collection
Prof Brian Ripley