Skip to content
Prev 60176 / 63424 Next

Crash/bug when calling match on latin1 strings

Hello,

R 4.1.1 on Ubuntu 20.04.

I can reproduce this error but not ~90% of the time, only the 1st time I 
run the script.
If I run other (terminal) commands before rerunning the R script it 
sometimes segfaults again but once again very far from 90% of the time.


rui at rui:~/tmp$ R -q -f rhelp.R
 > sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
  [1] LC_CTYPE=pt_PT.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=pt_PT.UTF-8        LC_COLLATE=pt_PT.UTF-8
  [5] LC_MONETARY=pt_PT.UTF-8    LC_MESSAGES=pt_PT.UTF-8
  [7] LC_PAPER=pt_PT.UTF-8       LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=pt_PT.UTF-8 LC_IDENTIFICATION=C

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

loaded via a namespace (and not attached):
[1] compiler_4.1.1
 >
 > # A bunch of words in UTF8; replace *'s
 > words <- readLines("h****://pastebin.c**/raw/MFCQfhpY", encoding = 
"UTF-8")
 > words2 <- iconv(words, "utf-8", "latin1")
 > gctorture(TRUE)
 > y <- match(words2, words2)

  *** caught segfault ***
address 0x10, cause 'memory not mapped'
*** recursive gc invocation
*** recursive gc invocation
*** recursive gc invocation
*** recursive gc invocation
*** recursive gc invocation
*** recursive gc invocation
*** recursive gc invocation
*** recursive gc invocation
*** recursive gc invocation
*** recursive gc invocation

Traceback:
  1: match(words2, words2)
An irrecoverable exception occurred. R is aborting now ...
Falta de segmenta??o (n?cleo despejado)



This last line is Portuguese for

Segmentation fault (core dumped)

Hope this helps,

Rui Barradas


?s 06:05 de 11/10/21, Travers Ching escreveu: