From dmurdoch at pair.com  Mon Jun  7 20:14:57 2004
From: dmurdoch at pair.com (Duncan Murdoch)
Date: Mon Jun  7 20:14:54 2004
Subject: [Rd] strange apparently data-dependent crash with large data
	(PR#6955)
In-Reply-To: <20040607165927.D6BD8108F1@slim.kubism.ku.dk>
References: <20040607165927.D6BD8108F1@slim.kubism.ku.dk>
Message-ID: <62c9c01e9n6c97icd6jf36v10euvdr0htk@4ax.com>

On Mon,  7 Jun 2004 18:59:27 +0200 (CEST), tplate@blackmesacapital.com
wrote :

>I'm consistently seeing R crash with a particular large data set.  What's 
>strange is that although the crash seems related to running out of memory, 
>I'm unable to construct a pseudo-random data set of the same size that also 
>causes the crash.  Further adding to the strangeness is that the crash only 
>happens if the dataset goes through a save()/load() cycle -- without that, 
>the command in question just gives an out-of-memory error, but does not crash.

This kind of error is very difficult to debug.  What's likely
happening is that in one case you run out of memory at a place with a
correct check, and in the other you are hitting some flaky code that
assumes every memory allocation is guaranteed to succeed.

You could install DrMinGW (which produces a stack dump when you
crash), but it's not necessarily informative:  often the crash occurs
relatively distantly from the buggy code that caused it.

The other problem with this kind of error is that it may well
disappear if you run under a debugger, since that will make you run
out of memory at a different spot, and it may not appear on a
different machine.  For example, I ran your examples and they all
failed because R ran out of memory, but none crashed.

Duncan Murdoch


[Rd] strange apparently data-dependent crash with large data (PR#6955)
Duncan Murdoch