Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does R interpreter segfault on an underscore?

Tags:

r

This is more out of curiosity than anything else, but why does an _ cause the R interpreter to segfault? More generally, is there a list somewhere of input characters that will cause the R interpreter to die?

When the following script is sourced, it causes the R interpreter to segfault.

for  (_ in 1:50) {
}

This is reproducible by running R on the command line and then typing

source("Foo.r")

I am running 3.0.2. I am curious because it took me some time to isolate this bug.

like image 932
merlin2011 Avatar asked Dec 01 '13 20:12

merlin2011


1 Answers

This is a known bug in R 3.0.2 that has already been fixed and will be available in the next release, as documented in the read me file for the latest patched sources. The R development team determined that this bug is not OS-specific and that it only affects R 3.0.2.

Read the bug report above and the source code for more details.

like image 181
asieira Avatar answered Oct 13 '22 13:10

asieira