From p.dalgaard@biostat.ku.dk  Fri Nov 26 23:55:04 1999
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 27 Nov 1999 00:55:04 +0100
Subject: memory.profile() messes up the vector heap on Alpha/Linux?
In-Reply-To: Peter Dalgaard BSA's message of "26 Nov 1999 22:27:54 +0100"
References: <Pine.SOL.4.10.9911261537120.3852-100000@sunflower.bio.indiana.edu> <x2vh6pndt1.fsf@blueberry.kubism.ku.dk>
Message-ID: <x2r9hc6c6f.fsf@blueberry.kubism.ku.dk>

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


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