Core dump on sapply misuse

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
17 Jan 1999 14:26:18 +0100


Norm Josephy <NJOSEPHY@bentley.edu> writes:

> Developers:
> 
> I hope this is the appropriate place to post this request. 
> 
> I am getting a core dump in an application of sapply.  A 
> simplified example is the following.  Because simplify=TRUE 
> is the default for sapply and tapply, the following works
> 
> 	x <- 1:5; sapply(x,list)
> 
> but the following dumps core with an access violation
> 
> 	x <- 1:5; myf <- function(x) list(x,x); sapply(x,myf)
> 	
> I am running R version 0.63.1 under Windows NT 4.00 (p.s. 
> and am also experiencing the 'impossible to access 
> clipboard' problem with graphics under NT but not under 
> Win95).

I believe that one got fixed in 0.63.2. My pre-0.63.3 snapshot gives

> x <- 1:5; myf <- function(x) list(x,x); sapply(x,myf)
     [,1]        [,2]        [,3]        [,4]        [,5]       
[1,] "Numeric,1" "Numeric,1" "Numeric,1" "Numeric,1" "Numeric,1"
[2,] "Numeric,1" "Numeric,1" "Numeric,1" "Numeric,1" "Numeric,1"

The bug was in the printing of "odd objects". Whether the above is a
sane representation of

> dput(sapply(x,myf))
structure(list(1, 1, 2, 2, 3, 3, 4, 4, 5, 5), .Dim = c(2, 5),
.Dimnames = list(NULL, NULL))

may still be open for debate, but at least the core dump is gone.

An NT version of 0.63.2 will be out when Guido finds the time. As I
understand the situation, this could be rather soon, unless he also
tries to fix the clipboard problem...

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