R-alpha: stack overflow

Paul Gilbert (la-jassine@aix.pacwan.net)
Tue, 11 Feb 1997 05:36:53 -0400


Date: Tue, 11 Feb 1997 05:36:53 -0400
To: R-testers@stat.math.ethz.ch
From: Paul Gilbert <la-jassine@aix.pacwan.net>
Subject: R-alpha: stack overflow

In R 0.16.1 I an getting a  stack overflow error which seems to be caused by
improper resolution of the method for a class. Here is an example:

simulate <- function (model, ...) UseMethod("simulate", model, ...)

simulate.TSestModel <- function (model, sd = NULL, SIGMA = NULL, ...) 
    {UseMethod("simulate", model$model, sd = sd, SIGMA = SIGMA, ...)}

simulate.TSmodel <- function (model, sd = NULL, SIGMA = NULL, ...) { T }

z <- 2

zz <- list(model=z, data=2)
class(zz) <- "TSestModel"

simulate(zz)

Error: stack overflow
> length(traceback())
[1] 111
> traceback()[1:10]
 [1] "simulate.TSestModel(zz)" "simulate.TSestModel(zz)"
 [3] "simulate.TSestModel(zz)" "simulate.TSestModel(zz)"
 [5] "simulate.TSestModel(zz)" "simulate.TSestModel(zz)"
 [7] "simulate.TSestModel(zz)" "simulate.TSestModel(zz)"
 [9] "simulate.TSestModel(zz)" "simulate.TSestModel(zz)"
>traceback()[105:111]
[1] "simulate.TSestModel(zz)" "simulate.TSestModel(zz)"
[3] "simulate.TSestModel(zz)" "simulate.TSestModel(zz)"
[5] "simulate.TSestModel(zz)" "simulate.TSestModel(zz)"
[7] "simulate(zz)"           
> 

Paul Gilbert

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-