Re: [R] segmentation fault - debugging

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Mon 06 Jun 2005 - 21:09:23 EST

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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Jun 06 21:14:27 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:23 EST