[R] R 1.6.1: help with debugging error in RunGenCollect(), R_gc_internal

Stephen Eglen eglen at pcg.wustl.edu
Mon Nov 11 19:18:21 CET 2002


Hi,

[System info: R 1.6.1 compiled from source (no args to configure) on
Redhat 7.1 Linux i/386]

I have some spatial statistics programs that recently (since R 1.6.1)
have generated SIGSEGV.  These R programs use the splancs library as
well as some C code of my own for Voronoi analysis.

The program has a big loop to fit various model parameters against a
spatial distribution of biological cells.  At some point, varying from
run to run, it generates the Segmentation fault:

Program received signal SIGSEGV, Segmentation fault.
0xffffffdc in ?? ()
(gdb) where
#0  0xffffffdc in ?? ()
#1  0x080bcae7 in RunGenCollect (size_needed=6777) at memory.c:1286
#2  0x080bdaa0 in R_gc_internal (size_needed=6777) at memory.c:1859
#3  0x080bd729 in Rf_allocVector (type=13, length=13554) at memory.c:1722
#4  0x08090a71 in CPtrToRObj (p=0x98db958, arg=0x98b29f8, Fort=1, type=13)
    at dotcode.c:209
#5  0x080933cb in do_dotCode (call=0x89f3880, op=0x8222154, args=0x833b380, 
    env=0x8346e90) at dotcode.c:1907
#6  0x080a035d in Rf_eval (e=0x89f3880, rho=0x8346e90) at eval.c:427
#7  0x080a195a in do_set (call=0x89f390c, op=0x8218610, args=0x89f38b8, 
    rho=0x8346e90) at eval.c:1102
#8  0x080a01e1 in Rf_eval (e=0x89f390c, rho=0x8346e90) at eval.c:404
#9  0x080a12e6 in do_begin (call=0x89f94f0, op=0x8218514, args=0x89f950c, 
    rho=0x8346e90) at eval.c:891
#10 0x080a01e1 in Rf_eval (e=0x89f94f0, rho=0x8346e90) at eval.c:404

[... The whole backtrace in this case goes to #64 frames, with many calls
to Rf_eval, do_begin, do_for, cut here for space...]

#59 0x080a03d5 in Rf_eval (e=0x8ba4b6c, rho=0x8228498) at eval.c:439
#60 0x080b8b56 in Rf_ReplIteration (rho=0x8228498, savestack=0, browselevel=0, 
    state=0xbfffefe0) at main.c:232
#61 0x080b8c95 in R_ReplConsole (rho=0x8228498, savestack=0, browselevel=0)
    at main.c:280
#62 0x080b9333 in run_Rmainloop () at main.c:579
#63 0x08118fb2 in main (ac=1, av=0xbffff4c4) at system.c:99
#64 0x4010a657 in __libc_start_main (main=0x8118f9c <main>, argc=1, 
    ubp_av=0xbffff4c4, init=0x805cdcc <_init>, fini=0x81a3810 <_fini>, 
    rtld_fini=0x4000dcd4 <_dl_fini>, stack_end=0xbffff4bc)
    at ../sysdeps/generic/libc-start.c:129

I'm sorry that I cannot report a consise example here that reproduces
the bug, but I am working on that.  My question for now is there a way
to find out what R command was being executed when the program
errored?

I tried running a recent unstable version of R (1.7.0, 2002-11-08),
and this time didn't get the SIGSEGV.  The only relevant NEWS item in
1.7.0 seems to be:

    o   The code underlying polygon drawing contained a memory leak.
	This showed up in persp, but did not affect other graphics
	functions.  It is now possible to draw big DEMs.


However, I think that is not the cause of this problem, I'm not using
persp in my code.  Also, the R process seems stable at about 30Mb.

Also, are ChangeLogs available for the unstable branch of R, or is it
just the NEWS file?

Any pointers to debugging this appreciated.

best wishes,
Stephen Eglen

-- 
Stephen Eglen					
Department of Anatomy and Neurobiology		eglen at thalamus.wustl.edu
Washington University School of Medicine        Tel: +1 314 362 4870    
St. Louis MO 63110  USA.			Fax: +1 314 747 1150

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list