From maechler at stat.math.ethz.ch  Mon Apr 11 08:57:31 2005
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Mon Apr 11 08:57:39 2005
Subject: [Rd] strange error with rw2010dev
In-Reply-To: <425969D4.9020105@acelerate.com>
References: <4248AC1A.3020104@acelerate.com> <425969D4.9020105@acelerate.com>
Message-ID: <16986.8155.624235.787171@stat.math.ethz.ch>

>>>>> "Kjetil" == Kjetil Brinchmann Halvorsen <kjetil@acelerate.com>
>>>>>     on Sun, 10 Apr 2005 14:00:52 -0400 writes:

    Kjetil> The error reported below still occurs in todays
    Kjetil> (2005-04-08) rw2010beta, should I file a formal bug
    Kjetil> report?

Thank you, Kjetil.

It seems nobody has found time to look at this in the mean time.
However,
I can confirm the bug on quite a different platform
(Linux Redhat 64-bit on AMD 64).
The problem is infinite recursion which you see more easily,
when you set something like options(expressions=500).

Further note that the bug is not new, it also happens in
previous versions of R ( -> i.e. no reason to stop using "R 2.1.0 beta"!)

Here's a ``pure script''

testmat <- matrix(1:80, 20,4)
dim(testmat)
#
testframe <- data.frame(testmat=I(testmat),
                        x=rnorm(20), y=rnorm(20), z=sample(1:20))
str(testframe)

options(expressions=100)
summary(testframe)
##> Error: evaluation nested too deeply: infinite recursion / options(expression=)?
## -- or --
##> Error: protect(): protection stack overflow


### In the second case, I at least get a useful trace back:

traceback() ## longish output, shows the infinite recursion:

..........................
...........................

17: summary.data.frame(data.frame(object), ...)
16: summary.matrix(object, digits = digits, ...)
15: summary.default(X[[1]], ...)
14: FUN(X[[1]], ...)
13: lapply(as.list(object), summary, maxsum = maxsum, digits = 12, 
        ...)
12: summary.data.frame(data.frame(object), ...)
11: summary.matrix(object, digits = digits, ...)
10: summary.default(X[[1]], ...)
9: FUN(X[[1]], ...)
8: lapply(as.list(object), summary, maxsum = maxsum, digits = 12, 
       ...)
7: summary.data.frame(data.frame(object), ...)
6: summary.matrix(object, digits = digits, ...)
5: summary.default(X[[1]], ...)
4: FUN(X[[1]], ...)
3: lapply(as.list(object), summary, maxsum = maxsum, digits = 12, 
       ...)
2: summary.data.frame(testframe)
1: summary(testframe)

--------

Thanks again for the report;
this should be fixable before release.

Martin


[Rd] strange error with rw2010dev
Martin Maechler