R-alpha: Transposition bug

Peter Dalgaard BSA p.dalgaard@kubism.ku.dk
09 Jun 1997 23:13:42 +0200


Shortest program to crash R?

> t(table(1))
Floating point exception (core dumped)

One-dimensional tables don't act like vectors, obviously. The crash
comes from an integer divide-by-zero (yup, that causes a SIGFPE) in

#0  0x8058e0b in do_transpose (call=0x4050c1e4, op=0x401c65fc, 
    args=0x4050c1bc, rho=0x4050e4e4) at array.c:545
545                             INTEGER(r)[i] = INTEGER(a)[(i / ncol)
+ (i % ncol) * nrow];


-- 
   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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-