[R] lty=NULL crashing R for x11(type="cairo")

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Mar 8 13:06:51 CET 2011


On Sat, 5 Mar 2011, Martin Maechler wrote:

>>>>>> "IZ" == Ista Zahn <izahn at psych.rochester.edu>
>>>>>>     on Sat, 5 Mar 2011 14:07:04 +0000 writes:
>
>    IZ> I confirm this bug exists and is 100% replicable on R
>    IZ> version 2.12.2 (2011-02-25) Platform: i686-pc-linux-gnu
>    IZ> (32-bit)
>
> WHoa... debugging ....
> ===> it *is* a bug in R after all :
>
>  > plot(1); axis(1, lty=NULL)
>
>   *** caught segfault ***
>  address 0x7fff423ab000, cause 'memory not mapped'
>
> and yes, the bug is device dependent:

But it is user error.  Since when has lty=NULL been a valid value?
Nowhere in the documentation for graphics devices does it say what to 
do with lty=NA_integer_, which is what do_axis maps NULL to.

> E.g., it nicely works for postscript() or pdf()
>
>> postscript(); plot(1); axis(1, lty=NULL) ; dev.off()
> null device
>          1

It writes a solid line: that's not 'nicely' in my book.  It's chance 
that it works on some devices.

> and it's ok for type = "Xlib", but not for the default
> type = "cairo":
>
>> x11(type="Xlib")
>> plot(1); axis(1, lty=NULL)
>> x11(type="cairo")
>> plot(1); axis(1, lty=NULL)
>
> *** caught segfault ***
> address 0x7fffd875f000, cause 'memory not mapped'
> /u/maechler/bin/R_arg: line 137: 14914 Segmentation fault      $exe $@
>
> Process R-devel exited abnormally with code 139 at Sat Mar  5 22:53:35 2011
>
> and similarly for
>
>> png(type="Xlib") # fine
>> png()            # not fine
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list