core dump involving function closure (PR#402)

jlindsey@alpha.luc.ac.be jlindsey@alpha.luc.ac.be
Tue, 25 Jan 2000 08:59:13 +0100 (MET)


A user has crashed R90.1 on MS Windows by succesive calls to two of my
formula/function interpretors in an order that I had not foreseen. I
have checked and this also occurs with Intel RH5.2. I have distilled
the problem down to its bare bones as the following set of
instructions:

func <- function(.mu){
	.ch1 <- deparse(.mu,width=500)[-1]
	.fn <- eval(parse(text=paste("function()",
		paste("eval(attr(.fn,\"model\"))"))))
	attr(.fn,"model") <- parse(text=.ch1)
	.fn}

mu <- function() eval(attr(.fn,"model"))
func(mu)()

debug does not help much. It looks like an infinite loop to me but
that is no excuse for a crash. I have modified my functions so that it
can now only occur in one very improbable case. Jim

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._