memory.profile() messes up the vector heap on Alpha/Linux?

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
27 Nov 1999 00:55:04 +0100


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

> Naoki Takebayashi <ntakebay@bio.indiana.edu> writes:
> 
> > Hello,
> > I have been trying to debug a problem with R-0.90.0 (this bug was in
> > 0.65.1, too). The following code results in seg faults.  It doesn't
> > seg-fault on Linux/intel.
> > 
> > > memory.profile()
> > > gc()
...
> The gdb command would be 'watch *0x20001840ef8' (it's important to use
> the address as a number so that one gets a hardware watchpoint), but

Doh! Never mind gdb, sometimes you just need to look at the code:

    PROTECT(ans = allocVector(INTSXP, 21));
    PROTECT(nms = allocVector(STRSXP, 21));
    for (i = 0; i < 21; i++) {
        STRING(ans)[i] = 0;
        STRING(nms)[i] = R_BlankString;
    }

Try making that INTEGER(ans)[i] = 0 ...

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