[R] segmentation fault - debugging

Duncan Murdoch murdoch at stats.uwo.ca
Mon Jun 6 13:09:23 CEST 2005


Joel Bremson wrote:
> Hi all,
> 
> I'm trying to debug some fortran 95 code that I'm bringing in
> with a dyn.load().
> 
> I'm compiling a number of files using g95 on intel linux w/ R 2.1.0.
> 
> The .so file loads without complaint, but when I try to call it I get a
> seg fault. I was hoping I could get a core dump in order to get some
> more clues about what is going on, but no luck.
> 
> I'm relatively new to fortran programming and have never used gdb before, 
> although
> I'm familiar with other debuggers.
> 
> Any tips on how to proceed from this point would be appreciated.

I find insight (a TCL/TK front end to gdb) easier to use than plain gdb, 
because it's more like other GUI-based debuggers.  I've also heard that 
ddb (I think that's the name) does a good job, but was never able to get 
it to run in Windows.  You might have more luck in Linux.

If you run R under the debugger, it will try to stop at the line that 
caused the seg fault.  This depends on the presence of debug info in the 
file, which might be your .so or R itself.  In Windows, "make distclean; 
make DEBUG=T" gets debug info into R; I don't know if that works for 
builds on other platforms.

Duncan Murdoch




More information about the R-help mailing list