Skip to content

new raster image support in r-devel

6 messages · Paul Murrell, Kasper Daniel Hansen, Simon Urbanek

#
Hi

In the *development* version of R, there are two new functions, 
grid.raster() and grid.cap(), in the 'grid' package, which draw (and 
capture) raster (bitmap) images
(see http://developer.r-project.org/Raster/raster-RFC.html)

There has been a report that this is not working on the quartz() device 
on MacOS X 10.5 (Leopard?), specifically i386-apple-darwin9.8.0

The test is simply ...

library(grid)
quartz()
grid.text("test")
cap <- grid.cap()
# Crash and burn

If anyone has a system like this, and is happy to install the 
development version of R on that system, I would appreciate a 
confirmation of this problem.

Thanks for any help

Paul
#
Leopard, latest version, using Apples gcc 4.2. SVN version r50716

I get a crash (memory not mapped).  The traceback shows grid.Call("L_cap"), followed by .Call(fname, ...., package = "grid")

Kasper
On Dec 13, 2009, at 21:47 PM, Paul Murrell wrote:

            
#
On Dec 13, 2009, at 21:47 , Paul Murrell wrote:

            
It works for me w/o problems:
Mac OS X 10.6.2 (10C540)
[R.app GUI 1.31 (5536) i386-apple-darwin9.8.0] (also directly)
R version 2.11.0 Under development (unstable) (2009-12-13 r50716)
i386-apple-darwin9.8.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets   
methods   base

(official Leopard build from r.research.att.com)

So if you can replicate this, please either a) get a full stack trace  
or b) specify exactly how you configure R, compilers, locale etc. Also  
make sure you don't have some old library with R packages around.

Cheers,
Simon
#
Oops, I was so focused on things breaking in SL that I missed that  
this one breaks on Leopard only :)
Anyway, yes, the exact same binary breaks on Leopard:

Reason: KERN_INVALID_ADDRESS at address: 0x168c8001
QuartzCocoa_Cap (dev=0x921d80, userInfo=0x9210f0) at ../../../../../../ 
R-devel/src/library/grDevices/src/qdCocoa.m:774
774	            rint[i] = ((screenData[i*4 + 2]) |
(gdb) bt
#0  QuartzCocoa_Cap (dev=0x921d80, userInfo=0x9210f0)  
at ../../../../../../R-devel/src/library/grDevices/src/qdCocoa.m:774
#1  0x00ce7b44 in RQuartz_Cap (dd=0x91d000) at ../../../../../../R- 
devel/src/library/grDevices/src/devQuartz.c:1033
#2  0x00cab6dc in L_cap () at ../../../../../../R-devel/src/library/ 
grid/src/grid.c:2851


I'll nave a look after I'm done with the 2.10.1 release...

Cheers,
Simon
On Dec 14, 2009, at 10:04 , Simon Urbanek wrote:

            
#
Hi
Simon Urbanek wrote:
That'd be great.  Thanks.

(Thanks also to Kasper for confirming the problem)

Paul

  
    
#
On Dec 14, 2009, at 14:25 , Paul Murrell wrote:

            
The crash is fixed, but there are IMHO serious issues with the  
infrastructure. More in separate e-mail...

Cheers,
Simon