Skip to content
Back to formatted view

Raw Message

Message-ID: <1dd941090911151801w5795d37bhaa692ebc516b29be@mail.gmail.com>
Date: 2009-11-16T02:01:33Z
From: nabble.30.miller_2555 at spamgourmet.com
Subject: Segmentation faults on SEXP conversion	20)
In-Reply-To: <4B00AB2E.5090205@stats.uwo.ca>

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