[R] Re: R-help Digest, Vol 17, Issue 25

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed Jul 28 01:28:11 CEST 2004


Ross Henderson <ross at ln.nimh.nih.gov> writes:

> hello,
> 
> I'm trying to use R to take an image matrix and paint it into a 
> tcltk canvas.  I'm using R-1.9.0 within ess-5.2.0 on a linux 
> machine running the 2.4.30-31.9smp kernel.  I'm using the
> ActiveTcl8.4.6.1-linux-ix86 tcltk libraries.
> 
> When I run the following comands, however, I get an R segmentation 
> fault:
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> > library(tcltk)
> > addTclPath("/usr/local/ActiveTcl/lib")
> > tclRequire("Img")
> <Tcl> 1.3
> >tkcmd("image","create","photo",tclVar(),file="/path/to/file.jpg")
> 
> Process R segmentation fault at Tue Jul 27 18:18:40 2004
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> I've run this as root, and I get the same segmentation fault,  So I don't 
> think this is a permissions problem.  Should I somehow be initializing 
> tclVar()?  Can anyone point me to the right way to run this piece of 
> code so that I don't get the segmentation fault?

You should assign tclVar() to something, or you will find it difficult
to access its value later on. Wouldn't expect that that could provoke a
segfault though. Could you get us a traceback from the debugger (gdb)?
Also, will similar code run from wish? (need to rule out that it could
be a problem entirely within Tcl).

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list