Dear R Team, First, thank you for incredibly useful software! Now the bad news: The attached script (or the original version with real data) will reliably crash R on my machine. I am using: R version: either 2.2.1 or 2.3.1 Windows 2000 Professional, Service Pack 4 512 MB of RAM On my machine the script will crash R on line 42 [ probits21 <- lapply(... ]. In both this script and the "real" one, memory.size() indicates that R is about 512 MB just before executing the command that crashes it. In other contexts, R has been able to allocate virtual memory on this computer without any trouble. Thanks again for all your work on R. Regards, Joe Ritter -------------------------------------------------------------------------- Joseph A. Ritter Associate Professor Humphrey Institute of Public Affairs University of Minnesota Minneapolis, MN 55455 U.S.A. 612-625-0442
This works for me on both Linux and Windows. Please check your memory usage: it does need about 900Kb of VM, and as you have less RAM than that installed you need to set --max-mem-size=1G or some such. (It is quite likely that this is a Windows memory allocation failure: that has been reported before but not tracked down.) On Wed, 14 Jun 2006, jritter at umn.edu wrote:> This is a multi-part message in MIME format. > --------------010500030900050501010804 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Dear R Team, > > First, thank you for incredibly useful software! > > Now the bad news: The attached script (or the original version with > real data) will reliably crash R on my machine. I am using: > > R version: either 2.2.1 or 2.3.1 > Windows 2000 Professional, Service Pack 4 > 512 MB of RAM > > On my machine the script will crash R on line 42 [ probits21 <- > lapply(... ]. > > In both this script and the "real" one, memory.size() indicates that R > is about 512 MB just before executing the command that crashes it. In > other contexts, R has been able to allocate virtual memory on this > computer without any trouble. > > Thanks again for all your work on R. > > Regards, > > Joe Ritter > > -------------------------------------------------------------------------- > Joseph A. Ritter > Associate Professor > Humphrey Institute of Public Affairs > University of Minnesota > Minneapolis, MN 55455 > U.S.A. > 612-625-0442 > > --------------010500030900050501010804 > Content-Type: text/plain; > name="crash.r" > Content-Transfer-Encoding: 7bit > Content-Disposition: inline; > filename="crash.r" > > x1 <- rnorm(10000) > x2 <- rnorm(10000) > x3 <- rnorm(10000) > x4 <- rnorm(10000) > x5 <- rnorm(10000) > x6 <- rnorm(10000) > x7 <- rnorm(10000) > x8 <- rnorm(10000) > y <- round(runif(10000)) > > specs <- list() > specs$A <- formula(y~x1+x2+x3+x4+x5+x6+x7+x8) > specs$B <- specs$A > specs$C <- specs$A > specs$D <- specs$A > specs$E <- specs$A > specs$F <- specs$A > specs$H <- specs$A > specs$I <- specs$A > specs$J <- specs$A > > probits1 <- lapply(specs, glm, family=binomial(link="probit")) > probits2 <- lapply(specs, glm, family=binomial(link="probit")) > probits3 <- lapply(specs, glm, family=binomial(link="probit")) > probits4 <- lapply(specs, glm, family=binomial(link="probit")) > probits5 <- lapply(specs, glm, family=binomial(link="probit")) > probits6 <- lapply(specs, glm, family=binomial(link="probit")) > probits7 <- lapply(specs, glm, family=binomial(link="probit")) > probits8 <- lapply(specs, glm, family=binomial(link="probit")) > probits9 <- lapply(specs, glm, family=binomial(link="probit")) > probits10 <- lapply(specs, glm, family=binomial(link="probit")) > probits11 <- lapply(specs, glm, family=binomial(link="probit")) > probits12 <- lapply(specs, glm, family=binomial(link="probit")) > probits13 <- lapply(specs, glm, family=binomial(link="probit")) > probits14 <- lapply(specs, glm, family=binomial(link="probit")) > probits15 <- lapply(specs, glm, family=binomial(link="probit")) > probits16 <- lapply(specs, glm, family=binomial(link="probit")) > probits17 <- lapply(specs, glm, family=binomial(link="probit")) > probits18 <- lapply(specs, glm, family=binomial(link="probit")) > probits19 <- lapply(specs, glm, family=binomial(link="probit")) > probits20 <- lapply(specs, glm, family=binomial(link="probit")) > probits21 <- lapply(specs, glm, family=binomial(link="probit")) > probits22 <- lapply(specs, glm, family=binomial(link="probit")) > probits23 <- lapply(specs, glm, family=binomial(link="probit")) > probits24 <- lapply(specs, glm, family=binomial(link="probit")) > probits25 <- lapply(specs, glm, family=binomial(link="probit")) > probits26 <- lapply(specs, glm, family=binomial(link="probit")) > probits27 <- lapply(specs, glm, family=binomial(link="probit")) > probits28 <- lapply(specs, glm, family=binomial(link="probit")) > probits29 <- lapply(specs, glm, family=binomial(link="probit")) > probits30 <- lapply(specs, glm, family=binomial(link="probit")) > probits31 <- lapply(specs, glm, family=binomial(link="probit")) > > --------------010500030900050501010804-- > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On 6/14/2006 4:44 PM, jritter at umn.edu wrote:> This is a multi-part message in MIME format. > --------------010500030900050501010804 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Dear R Team, > > First, thank you for incredibly useful software! > > Now the bad news: The attached script (or the original version with > real data) will reliably crash R on my machine. I am using: > > R version: either 2.2.1 or 2.3.1 > Windows 2000 Professional, Service Pack 4 > 512 MB of RAMI don't have any Win2K machines, but on an XP laptop with only 256M, I see the crash, just after failing a couple of times with out-of-memory errors. I'll see if I can track it down. Duncan Murdoch> > On my machine the script will crash R on line 42 [ probits21 <- > lapply(... ]. > > In both this script and the "real" one, memory.size() indicates that R > is about 512 MB just before executing the command that crashes it. In > other contexts, R has been able to allocate virtual memory on this > computer without any trouble. > > Thanks again for all your work on R. > > Regards, > > Joe Ritter > > -------------------------------------------------------------------------- > Joseph A. Ritter > Associate Professor > Humphrey Institute of Public Affairs > University of Minnesota > Minneapolis, MN 55455 > U.S.A. > 612-625-0442 > > --------------010500030900050501010804 > Content-Type: text/plain; > name="crash.r" > Content-Transfer-Encoding: 7bit > Content-Disposition: inline; > filename="crash.r" > > x1 <- rnorm(10000) > x2 <- rnorm(10000) > x3 <- rnorm(10000) > x4 <- rnorm(10000) > x5 <- rnorm(10000) > x6 <- rnorm(10000) > x7 <- rnorm(10000) > x8 <- rnorm(10000) > y <- round(runif(10000)) > > specs <- list() > specs$A <- formula(y~x1+x2+x3+x4+x5+x6+x7+x8) > specs$B <- specs$A > specs$C <- specs$A > specs$D <- specs$A > specs$E <- specs$A > specs$F <- specs$A > specs$H <- specs$A > specs$I <- specs$A > specs$J <- specs$A > > probits1 <- lapply(specs, glm, family=binomial(link="probit")) > probits2 <- lapply(specs, glm, family=binomial(link="probit")) > probits3 <- lapply(specs, glm, family=binomial(link="probit")) > probits4 <- lapply(specs, glm, family=binomial(link="probit")) > probits5 <- lapply(specs, glm, family=binomial(link="probit")) > probits6 <- lapply(specs, glm, family=binomial(link="probit")) > probits7 <- lapply(specs, glm, family=binomial(link="probit")) > probits8 <- lapply(specs, glm, family=binomial(link="probit")) > probits9 <- lapply(specs, glm, family=binomial(link="probit")) > probits10 <- lapply(specs, glm, family=binomial(link="probit")) > probits11 <- lapply(specs, glm, family=binomial(link="probit")) > probits12 <- lapply(specs, glm, family=binomial(link="probit")) > probits13 <- lapply(specs, glm, family=binomial(link="probit")) > probits14 <- lapply(specs, glm, family=binomial(link="probit")) > probits15 <- lapply(specs, glm, family=binomial(link="probit")) > probits16 <- lapply(specs, glm, family=binomial(link="probit")) > probits17 <- lapply(specs, glm, family=binomial(link="probit")) > probits18 <- lapply(specs, glm, family=binomial(link="probit")) > probits19 <- lapply(specs, glm, family=binomial(link="probit")) > probits20 <- lapply(specs, glm, family=binomial(link="probit")) > probits21 <- lapply(specs, glm, family=binomial(link="probit")) > probits22 <- lapply(specs, glm, family=binomial(link="probit")) > probits23 <- lapply(specs, glm, family=binomial(link="probit")) > probits24 <- lapply(specs, glm, family=binomial(link="probit")) > probits25 <- lapply(specs, glm, family=binomial(link="probit")) > probits26 <- lapply(specs, glm, family=binomial(link="probit")) > probits27 <- lapply(specs, glm, family=binomial(link="probit")) > probits28 <- lapply(specs, glm, family=binomial(link="probit")) > probits29 <- lapply(specs, glm, family=binomial(link="probit")) > probits30 <- lapply(specs, glm, family=binomial(link="probit")) > probits31 <- lapply(specs, glm, family=binomial(link="probit")) > > --------------010500030900050501010804-- > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Duncan Murdoch <murdoch at stats.uwo.ca> writes:> On 6/26/2006 7:31 AM, ripley at stats.ox.ac.uk wrote: > > This works for me on both Linux and Windows. > > > > Please check your memory usage: it does need about 900Kb of VM, and as you > > have less RAM than that installed you need to set --max-mem-size=1G or > > some such. > > > > (It is quite likely that this is a Windows memory allocation failure: that > > has been reported before but not tracked down.) > > I can make it reproducible now. It happens relatively quickly when I > set max-mem-size=100M. In R-devel, there's a call to malloc at line > 1952 of memory.c, and as R is running out of memory, that returns a -1 > instead of a zero. This causes a seg fault a few lines later. > > The malloc code is quite complicated, so I can't see exactly why we're > getting the -1.Hmm, some specs (www.opengroup.org) for malloc have the following RETURN VALUE Upon successful completion with size not equal to 0, malloc() shall return a pointer to the allocated space. If size is 0, either a null pointer or a unique pointer that can be successfully passed to free() shall be returned. Otherwise, it shall return a null pointer and set errno to indicate the error. so the only standards-conforming interpretation of a -1 return is that the request was for 0 bytes, and "-1" is the representation of the unique pointer which can be passed to free(). Then again, when was a Windows lib ever standards-conforming? BTW, malloc never returns zero, but possibly NULL. -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
This is now fixed. Thanks for the report and the code to reproduce it. Duncan Murdoch On 6/14/2006 4:44 PM, jritter at umn.edu wrote:> This is a multi-part message in MIME format. > --------------010500030900050501010804 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Dear R Team, > > First, thank you for incredibly useful software! > > Now the bad news: The attached script (or the original version with > real data) will reliably crash R on my machine. I am using: > > R version: either 2.2.1 or 2.3.1 > Windows 2000 Professional, Service Pack 4 > 512 MB of RAM > > On my machine the script will crash R on line 42 [ probits21 <- > lapply(... ]. > > In both this script and the "real" one, memory.size() indicates that R > is about 512 MB just before executing the command that crashes it. In > other contexts, R has been able to allocate virtual memory on this > computer without any trouble. > > Thanks again for all your work on R. > > Regards, > > Joe Ritter > > -------------------------------------------------------------------------- > Joseph A. Ritter > Associate Professor > Humphrey Institute of Public Affairs > University of Minnesota > Minneapolis, MN 55455 > U.S.A. > 612-625-0442 > > --------------010500030900050501010804 > Content-Type: text/plain; > name="crash.r" > Content-Transfer-Encoding: 7bit > Content-Disposition: inline; > filename="crash.r" > > x1 <- rnorm(10000) > x2 <- rnorm(10000) > x3 <- rnorm(10000) > x4 <- rnorm(10000) > x5 <- rnorm(10000) > x6 <- rnorm(10000) > x7 <- rnorm(10000) > x8 <- rnorm(10000) > y <- round(runif(10000)) > > specs <- list() > specs$A <- formula(y~x1+x2+x3+x4+x5+x6+x7+x8) > specs$B <- specs$A > specs$C <- specs$A > specs$D <- specs$A > specs$E <- specs$A > specs$F <- specs$A > specs$H <- specs$A > specs$I <- specs$A > specs$J <- specs$A > > probits1 <- lapply(specs, glm, family=binomial(link="probit")) > probits2 <- lapply(specs, glm, family=binomial(link="probit")) > probits3 <- lapply(specs, glm, family=binomial(link="probit")) > probits4 <- lapply(specs, glm, family=binomial(link="probit")) > probits5 <- lapply(specs, glm, family=binomial(link="probit")) > probits6 <- lapply(specs, glm, family=binomial(link="probit")) > probits7 <- lapply(specs, glm, family=binomial(link="probit")) > probits8 <- lapply(specs, glm, family=binomial(link="probit")) > probits9 <- lapply(specs, glm, family=binomial(link="probit")) > probits10 <- lapply(specs, glm, family=binomial(link="probit")) > probits11 <- lapply(specs, glm, family=binomial(link="probit")) > probits12 <- lapply(specs, glm, family=binomial(link="probit")) > probits13 <- lapply(specs, glm, family=binomial(link="probit")) > probits14 <- lapply(specs, glm, family=binomial(link="probit")) > probits15 <- lapply(specs, glm, family=binomial(link="probit")) > probits16 <- lapply(specs, glm, family=binomial(link="probit")) > probits17 <- lapply(specs, glm, family=binomial(link="probit")) > probits18 <- lapply(specs, glm, family=binomial(link="probit")) > probits19 <- lapply(specs, glm, family=binomial(link="probit")) > probits20 <- lapply(specs, glm, family=binomial(link="probit")) > probits21 <- lapply(specs, glm, family=binomial(link="probit")) > probits22 <- lapply(specs, glm, family=binomial(link="probit")) > probits23 <- lapply(specs, glm, family=binomial(link="probit")) > probits24 <- lapply(specs, glm, family=binomial(link="probit")) > probits25 <- lapply(specs, glm, family=binomial(link="probit")) > probits26 <- lapply(specs, glm, family=binomial(link="probit")) > probits27 <- lapply(specs, glm, family=binomial(link="probit")) > probits28 <- lapply(specs, glm, family=binomial(link="probit")) > probits29 <- lapply(specs, glm, family=binomial(link="probit")) > probits30 <- lapply(specs, glm, family=binomial(link="probit")) > probits31 <- lapply(specs, glm, family=binomial(link="probit")) > > --------------010500030900050501010804-- > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel