From pdenis2@home.com  Fri Feb 16 04:35:06 2001
From: pdenis2@home.com (pdenis2@home.com)
Date: Fri, 16 Feb 2001 05:35:06 +0100 (MET)
Subject: [Rd] print.matrix segfaults if rowlab vector too short (PR#850)
Message-ID: <200102160435.FAA08793@pubhealth.ku.dk>

print.matrix(x) segfaults if the vector supplied to 'rowlab' is
*shorter* than nrow(x):

> version
         _
platform i686-pc-linux-gnu
arch     i686
os       linux-gnu
system   i686, linux-gnu
status
major    1
minor    2.1
year     2001
month    01
day      15
language R
[installed from RPM]

> x<-1:4
> dim(x)<-c(2,2)
> x
     [,1] [,2]
[1,]    1    3
[2,]    2    4
> print.matrix(x)
     [,1] [,2]
[1,]    1    3
[2,]    2    4
> print.matrix(x,rowlab=c('a','b'))
  [,1] [,2]
a    1    3
b    2    4
> print.matrix(x,rowlab=c('a','b','c'))
  [,1] [,2]
a    1    3
b    2    4                                             [OK, ignores
extra labels ...]
> print.matrix(x,rowlab=c('a'))
Segmentation fault (core dumped)

Similar behavior for 'collab' ...



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


[Rd] print.matrix segfaults if rowlab vector too short (PR#850)
pdenis2@home.com