From jlindsey@alpha.luc.ac.be  Tue Jan 25 07:59:13 2000
From: jlindsey@alpha.luc.ac.be (jlindsey@alpha.luc.ac.be)
Date: Tue, 25 Jan 2000 08:59:13 +0100 (MET)
Subject: core dump involving function closure (PR#402)
Message-ID: <200001250759.IAA03338@pubhealth.ku.dk>

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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


core dump involving function closure (PR#402)
jlindsey@alpha.luc.ac.be