[Rd] segfault

Peter Dalgaard BSA p.dalgaard@pubhealth.ku.dk
20 Feb 2001 21:09:21 +0100


Paul Gilbert <pgilbert@bank-banque-canada.ca> writes:

> I've managed to trap the following segfault with xxgdb and gctorture() set. The
> segfault seems to move around if gctorture() is not set, but has now occurred twice
> in the same spot with it set.  xxgdb gives the message
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x71244 in RunGenCollect (size_needed=2) at memory.c:1027
> 
> and the source listing points to FORWARD_CHILDREN(s); in the following section from
> src/main/memory.c
> 
> #ifndef EXPEL_OLD_TO_NEW
>     /* scan nodes in uncollected old generations with old-to-new pointers */
>     for (gen = num_old_gens_to_collect; gen < NUM_OLD_GENERATIONS; gen++)
>  for (i = 0; i < NUM_NODE_CLASSES; i++)
>      for (s = NEXT_NODE(R_GenHeap[i].OldToNew[gen]);
>    s != R_GenHeap[i].OldToNew[gen];
>    s = NEXT_NODE(s))
>   FORWARD_CHILDREN(s);
> #endif
> 

This just shows that something corrupted the memory handling. The
actual bug is probably somewhat prior to this. If you do a "bt"
(backtrace) and go "up" a couple of times, you might find a spot where
someone forgot to PROTECT() a newly created R object.


> P.S. If someone can quickly tell me the trick to make cut and paste work with xxgdb
> in Solaris I would appreciate it. (I realize I should probably read the manual, but
> if it is simple please let me know.)

I gave up on xxgdb long ago because I thought it was enough to have to
deal with bugs in our own programs! However, it would seem that the
ordinary mousing techniques works as usual on Linux. Command-line
recall appears to be shot, however.

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