[Rd] how to trace what crashes R

From: Vladimir Eremeev <wl2776_at_gmail.com>
Date: Wed 24 Jan 2007 - 19:15:49 GMT

I am writing bindings to the C library (neural network simulator SNNS). DLL was produced with the command
R CMD SHLIB [source with C-wrappers, callable from R with .C and all sources from the snns kernel]
I used latest MinGW.

The problem is. R crashes with the "segmentation violation". Tracing with the insight and with simple Rprintf's gave me that crash occurs on the call of the function deeply in the snns kernel. That is, R correctly calls C wrapper, it calls the kernel function from the so called "user interface" part, it calls another C function from the internals, and that one calls the third C function. And the segmentation fault occurs on the call of that function, it doesn't do anything, its arguments have correct values, and it works in the other situations, for example, when I run executables from the SNNS (either gui version of the simulator, or batch interpreter). Moreover, I don't think the reason in the incorrect arguments, since the called function doesn't do anything.
Rprintf in the very beginning of its body doesn't work (I traced it in console mode of R).

How could I trace, what happens?

View this message in context: http://www.nabble.com/how-to-trace-what-crashes-R-tf3083985.html#a8570488
Sent from the R devel mailing list archive at Nabble.com.

R-devel@r-project.org mailing list
Received on Thu Jan 25 15:23:40 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 25 Jan 2007 - 13:31:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.