Hello! I am undertaking my first attempt at using compiled C code within R and have run into this lovely problem when I call my C code (using .C). The instruction at "0x10001d1b" referenced memory at "0x01fa2000". The memory could not be "written". Now this doesn't happen every time and furthermore I've tested the code in plain C and it all works fine leading me to think has been caused by an insidious misuse of pointers somewhere or other. I'm guessing I am overwriting some bit of memory that actually belongs to R. However, before I start checking and rechecking all my memory management I just wanted to see if there is are any other paths I should be investigating. Regards, Jared [[alternative HTML version deleted]]
On Tue, 3 May 2005 Jared.O'Connell@csiro.au wrote:> I am undertaking my first attempt at using compiled C code within R and > have run into this lovely problem when I call my C code (using .C). > > The instruction at "0x10001d1b" referenced memory at "0x01fa2000". The > memory could not be "written". > > Now this doesn't happen every time and furthermore I've tested the code > in plain C and it all works fine leading me to think has been caused by > an insidious misuse of pointers somewhere or other. I'm guessing I am > overwriting some bit of memory that actually belongs to R. However, > before I start checking and rechecking all my memory management I just > wanted to see if there is are any other paths I should be investigating.If you run R under a debugger such as gdb you will get much more useful information. You haven't even told us your OS: for UNIX-alikes using R -d gdb is the most common way. -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Sorry - I *was* using Windows. Rebooted in Linux and ran R -d gdb subsequently found and fixed problem in less than 5 minutes (runaway pointer). Lesson learned. Thanks, Jared -----Original Message----- From: Wolfgang Huber [mailto:huber@ebi.ac.uk] Sent: Tue 5/3/2005 6:54 PM To: Prof Brian Ripley Cc: O'Connell, Jared (CMIS, Floreat); r-devel@stat.math.ethz.ch Subject: Re: [Rd] memory problem Prof Brian Ripley wrote:> > If you run R under a debugger such as gdb you will get much more useful > information. You haven't even told us your OS: for UNIX-alikes using > > R -d gdb > > is the most common way.And R -d ddd (set the option "Run in separate execution window" before starting R) offers a nice GUI for the debugger. Obviously, you need to have installed ddd: http://www.gnu.org/software/ddd/ Best regards Wolfgang ------------------------------------- Wolfgang Huber European Bioinformatics Institute European Molecular Biology Laboratory Cambridge CB10 1SD England Phone: +44 1223 494642 Fax: +44 1223 494486 Http: www.ebi.ac.uk/huber
Seemingly Similar Threads
- formatC with illegal input crashes Rgui (PR#7686)
- Subsetting an array by a vector of dimensions
- SVG and tooltips, hyperlinks
- Unexpected side effect of the ":::" operator on the value of isGeneric
- Unexpected difference in Bounding Box of PDF graphics between (PR#9072)