[Rd] "a.matrix[a.char.matrix]<- " crashes R (PR#447)

p.dalgaard@biostat.ku.dk p.dalgaard@biostat.ku.dk
Fri, 18 Feb 2000 17:05:50 +0100 (MET)


Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:

> Still crashes for me!

[Directed back to R-bugs, and please keep it there!]

OK, there are two issues here:

(a) matrix subscripting doesn't work with character type. Plain and
simple. A matrix subscript just get flattened into a character vector
and then used for subscripting. We might want to give an error instead
or simply implement the expected behaviour, but not this close to a
major release, I think. (Splus cant do this either)

(b) There's a bug in string indexing:

  x<-1:2
  x[c("2","2")]<-2
  x

Program received signal SIGSEGV, Segmentation fault. <etc>

It seems to happen only when there are repeated indices. The bug is
that the names component of x which is originally empty isn't filled
with "" for the first elements as it usually is but has NULL (0x0)
pointers there.

Will dig deeper...

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