From p.dalgaard@pubhealth.ku.dk  Tue Feb 20 20:09:21 2001
From: p.dalgaard@pubhealth.ku.dk (Peter Dalgaard BSA)
Date: 20 Feb 2001 21:09:21 +0100
Subject: [Rd] segfault
In-Reply-To: Paul Gilbert's message of "Tue, 20 Feb 2001 13:12:19 -0500"
References: <3A92B383.422D1435@bank-banque-canada.ca>
Message-ID: <x266i5m80e.fsf@blueberry.kubism.ku.dk>

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


[Rd] segfault
Peter Dalgaard BSA