[Rd] Segmentation faults on SEXP conversion 20)

nabble.30.miller_2555 at spamgourmet.com nabble.30.miller_2555 at spamgourmet.com
Mon Nov 16 03:01:33 CET 2009


On Sun, Nov 15, 2009 at 8:30 PM, Duncan Murdoch - murdoch at stats.uwo.ca
<+nabble+miller_2555+1412c7fca2.murdoch#stats.uwo.ca at spamgourmet.com>
wrote:
> On 15/11/2009 8:25 PM, nabble.30.miller_2555 at spamgourmet.com wrote:
>> ptest.c:
>> ---------------------------------------------------
>> #include <R.h>
>> void Rwrite() { printf("[%i] %s",12,"Hi"); }
>
> I forget if you said which system you're working on, but it may be that you
> don't have an open file handle for printf to use.  Use Rprintf instead and
> things should be fine.
>
> Duncan Murdoch

Thank you - I attempted to use Rprintf as suggested. I also attempted
fprintf() using stdout. The platform is Linux
2.6.27.30-170.2.82.fc10.x86_64. It's a Fedora Core v10. I encountered
the same issue with both R v. 2.9.2 and 2.10.0 (currently running the
latter). If it helps, the following is the memcheck output after
making the suggested changes:
==25809== Invalid read of size 1
==25809==    at 0x4D04209: SET_SYMVALUE (in /usr/lib64/R/lib/libR.so)
==25809==    by 0x4D01E51: Rf_ReplIteration (in /usr/lib64/R/lib/libR.so)
==25809==    by 0x4D020B7: (within /usr/lib64/R/lib/libR.so)
==25809==    by 0x4D027CF: run_Rmainloop (in /usr/lib64/R/lib/libR.so)
==25809==    by 0x40083A: main (in /usr/lib64/R/bin/exec/R)
==25809==  Address 0x3 is not stack'd, malloc'd or (recently) free'd



More information about the R-devel mailing list