Re: [Rd] Segmentation faults on SEXP conversion 20)

From: <nabble.30.miller_2555_at_spamgourmet.com>
Date: Sun, 15 Nov 2009 21:01:33 -0500

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@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

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 16 Nov 2009 - 02:06:36 GMT

This archive was generated by hypermail 2.2.0 : Mon 16 Nov 2009 - 02:50:25 GMT