Batch: Putting q(save=F) at the end of my file does not work in my context because I can no longer source the file without quitting. I have that quit statement in my .First so that I always quit that way interactively. The problem is that it is ignored in batch. eigen: The crash occurs on my 586 running Red Hat Linux 2.0.27 but not on my son's 486 running SLackware Linix 2.0.29. We both have the same most recent libraries installed (libc, libm, etc). I started looking in the eispack C code and traced down the problem. In three of the four Fortran calls in eigen, (ch,rs,cg but not rg), the same vector (vals) is used for the return eigenvalues as for two or three temporary workspace vectors. This is risky programming at any time and leads to a catastrophe with a 586 where several things may be calculated at the same time. If the variable, vals, is removed and all use of it in the .Fortran call replaced by double(n) (as in the call to rg), eigen works on a 586. This sort of problem should be checked elsewhere in R. 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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>>>>> "Jim" == Jim Lindsey <jlindsey@luc.ac.be> writes:Jim> Batch: Putting q(save=F) at the end of my file does not work in my Jim> context because I can no longer source the file without Jim> quitting. I have that quit statement in my .First so that I always Jim> quit that way interactively. The problem is that it is ignored in Jim> batch. I've tested the following, and it seems to work : Add if(!interactive()) q(save = "no") at the end of your batch files. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
On Mon, 25 Aug 1997, Jim Lindsey wrote:> > eigen: > I started looking in the eispack C code and traced down the > problem. In three of the four Fortran calls in eigen, (ch,rs,cg but > not rg), the same vector (vals) is used for the return eigenvalues as > for two or three temporary workspace vectors. This is risky > programming at any time and leads to a catastrophe with a 586 where > several things may be calculated at the same time.No, this is a bug in .Fortran. Everything sent to C or FORTRAN code is supposed to be a *copy* of the R object. This is because R is allowed to move things around in memory whenever it feels the urge, but C and FORTRAN assume things stay fixed. Since everything is supposed to be copied there is no harm in using multiple copies of the same thing. One possible source of this bug is in naoktrim in src/main/dotcode.c which begins static SEXP naoktrim(SEXP s, int * len, int *naok, int *dup) { SEXP value; if(s == R_NilValue) { value = R_NilValue; *naok = 0; *dup = 0; *len = 0; } but should begin static SEXP naoktrim(SEXP s, int * len, int *naok, int *dup) { SEXP value; if(s == R_NilValue) { value = R_NilValue; *naok = 0; *dup = 1; *len = 0; } Thomas Lumley ------------------------------------------------------+------ Biostatistics : "Never attribute to malice what : Uni of Washington : can be adequately explained by : Box 357232 : incompetence" - Hanlon's Razor : Seattle WA 98195-7232 : : ------------------------------------------------------------ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-