Re: [R] "Memory not mapped" when using .C, problem in Mac but not in Linux

2010-10-14 Thread David
Thank you, William and Berend, for your thorough replies. I have still the habit of setting "long int" variables because, when I first learnt C, the manual said that "int" could be up to around 3.2e4. But I suppose that, in systems from 32 bits, an "int" number can be much larger, isn't it? - whic

Re: [R] "Memory not mapped" when using .C, problem in Mac but not in Linux

2010-10-13 Thread Berend Hasselman
- which version of Mac OS X? - Which version of R? (version, architecture) - Officially provided R or compiled by you? Official R is compiled with Apple gcc. - if R was compiled with Apple compiler, who knows what can happen if you link with code compiled with a non Apple gcc? - if the code runs o

Re: [R] "Memory not mapped" when using .C, problem in Mac but not in Linux

2010-10-13 Thread William Dunlap
unlap tibco.com From: David [mailto:david.mailli...@gmail.com] Sent: Wednesday, October 13, 2010 11:13 AM To: William Dunlap Cc: r-help@r-project.org Subject: Re: [R] "Memory not mapped" when using .C,proble

Re: [R] "Memory not mapped" when using .C, problem in Mac but not in Linux

2010-10-13 Thread David
Thank you very much for your kind reply. I used gdb, and it returns a reason "KERN_INVALID_ADDRESS" on a very simple operation (obtaining the time step for a numerical integration). Please see bellow. But, um, I solved it by changing the function's arguments in the C code from "unsigned long int"

Re: [R] "Memory not mapped" when using .C, problem in Mac but not in Linux

2010-10-13 Thread William Dunlap
This often happens when your C code uses memory that it did not allocate, particularly when it reads or writes just a little beyond the end of a memory block. On some platforms or if you are lucky there is unused memory between blocks of allocated memory and you don't see a problem. Other machines