Skip to content
Prev 23321 / 63424 Next

R windows crash (PR#9426)

The problem is rather that 'aa' *is* found: default arguments are looked 
for within the body of the function, and so the calculation of 'aa' is 
recursive.  Consider the simpler case
Error in testfun() : recursive default argument reference

On Linux I got
Error: segfault from C stack overflow

Now C stack overflows are instantly fatal on Windows and cannot be caught 
there.  However, using Linux enabled me to locate the loop in a debugger, 
and it is recursion in isMissing to which I have added a stack check.

The remedy is I hope obvious: 'don't do that'.

Adding these checks do have a small but measurable performance cost so we 
have been conservative in adding them.
On Thu, 21 Dec 2006, robert.denham at nrm.qld.gov.au wrote: