[Rd] R 2.1 dies when some text() arguments are NULL (PR#7477)

MSchwartz at MedAnalytics.com MSchwartz at MedAnalytics.com
Fri Jan 7 05:11:33 CET 2005


On Fri, 2005-01-07 at 04:44 +0100, Robert_Keefe at umit.maine.edu wrote:
> 
> [My very deepest apologies in advance if this is not plain text; I am 
> recently at a new job in a windows-based environment and have 
> not yet set up my favorite old (pine) system. I have tried my best to 
> strip all formatting from the message..]
> 
> I'm overlaying plots of tree locations mapped before and after 
> logging activities and checking my matched individuals using 
> several arguments to text() which plot tree attributes by or 
> near their (x,y) locations. R 2.1 dies when a coding error on 
> my part results in a null data.frame...
> 
> Example: 
> 
> plot(1)
> text(NULL ~ NULL, label=NULL)
> 
> This happens for me under Windows 98 and XP. Andrew Robinson 
> was kind enough to try it for me on FreeBSD with the same result. 
> The code returns nothing for me under R 1.9 on Windows 98 and 
> XP (same win. machines).  The version details of the three 
> are as follows:
> 
> # FreeBSD:
> 
> >version
>          _                      
> platform i386-portbld-freebsd5.3
> arch     i386                   
> os       freebsd5.3             
> system   i386, freebsd5.3       
> status                          
> major    2                      
> minor    0.1                    
> year     2004                   
> month    11                     
> day      15                     
> language R                      
> 
> # Windows XP:
> 
> > version
>          _              
> platform i386-pc-mingw32
> arch     i386           
> os       mingw32        
> system   i386, mingw32  
> status                  
> major    2              
> minor    0.1            
> year     2004           
> month    11             
> day      15             
> language R       
> 
> # Windows 98:
> 
> > version
>          _              
> platform i386-pc-mingw32
> arch     i386           
> os       mingw32        
> system   i386, mingw32  
> status                  
> major    2              
> minor    0.1            
> year     2004           
> month    11             
> day      15             
> language R           
> 
> Please let me know if I can add any more details-
> 
> Thank you,
> 
> Rob 

Your subject line and body refer to R version 2.1, which technically
does not exist as 2.1.0 is the current development version. 

However, your output above indicates that R version 2.0.1 is what you
have installed on the three platforms. That is the current released
version.

In either case, using:

Version 2.0.1 Patched (2005-01-02)

I get the following:

> plot(1)
> text(NULL ~ NULL, label=NULL)
Error in text(xy.coords(x, y, recycle = TRUE), labels, adj, pos,
offset,  :
        no coordinates were supplied


Same thing with:

> plot(1)
> text(NULL, NULL, label = NULL)
Error in text.default(NULL, NULL, label = NULL) :
        x and y lengths differ in text().


No crash.


There is the following note in the NEWS file for 2.0.1 patched:

"text()'s default method could segfault if passed 0-length coordinates."

So I believe that this fixes the issue that you have posted about.


A patched version for Windows is available via CRAN:

http://www.cran.mirrors.pair.com/bin/windows/base/rpatched.html

and a source code tarball is available for the *nix versions via the FTP
link under the R Sources link:

ftp://ftp.stat.math.ethz.ch/Software/R/

HTH,

Marc Schwartz



More information about the R-devel mailing list