Why is it sometimes segfault in R when specifying custom line types?

Why do I get R-crashing segfaults when specifying custom linetypes in R? The four types of lines below are, in fact, identical, because they cycle through the same size of dashes and spaces in the same order (they only begin at different points in the cycle).

plot.new() abline(0.1,0,lty='28282383') # works abline(0.2,0,lty='83282823') # works abline(0.3,0,lty='28238328') # segfault abline(0.4,0,lty='23832828') # segfault 

Here is the complete error message for the first of two deadly lines above:

  *** caught segfault *** address 0xbf981000, cause 'memory not mapped' Segmentation fault 
+4
source share
2 answers

It looks like a bug in the Cairo graphics device - I am getting crashes with the default graphics device X11() , but not with X11(type="Xlib") or pdf() . RStudio can work because it can use its own methods to capture graphics.

I see nothing about this in 2.15.1-patched description:

http://cran.r-project.org/bin/windows/base/NEWS.R-2.15.1patched.html

so I tried this and now reported it as an error:

https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15055

+3
source

It seems to work for me through RStudio on Mac. Which OS? What version of R?

 > plot.new() > abline(0.1,0,lty='28282383') # works > abline(0.2,0,lty='83282823') # works > abline(0.3,0,lty='28238328') # segfault > abline(0.4,0,lty='23832828') # segfault > sessionInfo() R version 2.15.0 (2012-03-30) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) locale: [1] C/en_US.UTF-8/C/C/C/C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] reshape2_1.2.1 loaded via a namespace (and not attached): [1] plyr_1.7.1 stringr_0.6.1 tools_2.15.0 

enter image description here

0
source

Source: https://habr.com/ru/post/1435604/


All Articles