In R 3.11.1 (also in R 3.0.3), the function encodeString causes a 'memory not mapped' segfault if the character string has more than about 5e8 characters. I got this segfault first when running str on a large string generated by serialize, and reduced the problem to one with encodeString.
Here is how to reproduce:
> r <- rep("test ", 1e8)
> txt <- paste(r, collapse="")
> en <- encodeString(txt)
*** caught segfault ***
address 0x5f95000, cause 'memory not mapped'
*** caught bus error ***
address (nil), cause 'unknown'
system x86_64, linux-gnu
svn rev 66115
version.string R version 3.1.1 (2014-07-10)
nickname Sock it to Me
This bug / infelicity is still present in today's R (incl R-devel).
It takes a few seconds to run.
As usual: It is an integer overflow.
I'm fixing it currently.. does not seem to be too hard.
Fix committed to R-devel (svn r73008) and R 3.4.1-patched (r73009)