J.C.Rougier@durham.ac.uk
2000-Mar-22 18:25 UTC
[Rd] segmentation fault with 1D array (PR#500)
Here's a nasty one. The following has caused a segmentation fault and possibly also a bus error. fred <- 1:6 dim(fred) <- 6 dimnames(fred) <- list(LETTERS[1:6]) mm <- matrix(1:12, 2, 6) mm %*% fred # segmentation fault here In the case without the dimnames assignment the result is OK. Cheers, Jonathan. --please do not edit the information below-- Version: platform = sparc-sun-solaris2.7 arch = sparc os = solaris2.7 system = sparc, solaris2.7 status = Patched major = 0 minor = 99.0 year = 2000 month = February day = 9 language = R Search Path: .GlobalEnv, Autoloads, package:base -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 Wed, 22 Mar 2000 J.C.Rougier@durham.ac.uk wrote:> Here's a nasty one. The following has caused a segmentation > fault and possibly also a bus error. > > fred <- 1:6 > dim(fred) <- 6 > dimnames(fred) <- list(LETTERS[1:6]) > mm <- matrix(1:12, 2, 6) > > mm %*% fred # segmentation fault here > > In the case without the dimnames assignment the result is OK.Here (1.0.0 on RH 6.0) I get Error: invalid type for dimname (must be a vector) instead of a segmentation fault.> > --please do not edit the information below-- > > Version: > platform = sparc-sun-solaris2.7 > arch = sparc > os = solaris2.7 > system = sparc, solaris2.7 > status = Patched > major = 0 > minor = 99.0 > year = 2000 > month = February > day = 9 > language = R > > Search Path: > .GlobalEnv, Autoloads, package:base > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ > >-- Ben Bolker bolker@zoo.ufl.edu Zoology Department, University of Florida http://www.zoo.ufl.edu/bolker 318 Carr Hall/Box 118525 tel: (352) 392-5697 Gainesville, FL 32611-8525 fax: (352) 392-3704 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
J.C.Rougier@durham.ac.uk writes:> Here's a nasty one. The following has caused a segmentation > fault and possibly also a bus error. > > fred <- 1:6 > dim(fred) <- 6 > dimnames(fred) <- list(LETTERS[1:6]) > mm <- matrix(1:12, 2, 6) > > mm %*% fred # segmentation fault here > > In the case without the dimnames assignment the result is OK.Still present... Some pretty odd things appear to be going on there. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Weird. It does crash if I run it in a new session. I tried the commands out in a session that I'd already done a whole lot in, so maybe it's just corrupting some little piece of my (large) environment rather than segfaulting. On 22 Mar 2000, Peter Dalgaard BSA wrote:> Ben Bolker <ben@zoo.ufl.edu> writes: > > > On Wed, 22 Mar 2000 J.C.Rougier@durham.ac.uk wrote: > > > > > Here's a nasty one. The following has caused a segmentation > > > fault and possibly also a bus error. > > > > > > fred <- 1:6 > > > dim(fred) <- 6 > > > dimnames(fred) <- list(LETTERS[1:6]) > > > mm <- matrix(1:12, 2, 6) > > > > > > mm %*% fred # segmentation fault here > > > > > > In the case without the dimnames assignment the result is OK. > > > > Here (1.0.0 on RH 6.0) I get > > > > Error: invalid type for dimname (must be a vector) > > > > instead of a segmentation fault. > > Hm? 1.0.0 on RH 6.1 gives the segfault for me as does later patch > versions... > >-- Ben Bolker bolker@zoo.ufl.edu Zoology Department, University of Florida http://www.zoo.ufl.edu/bolker 318 Carr Hall/Box 118525 tel: (352) 392-5697 Gainesville, FL 32611-8525 fax: (352) 392-3704 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._