Hi... I have come upon a problem with a regular expression which causes base-R to freeze. I have reproduced the phenomenon on several machines running R under Windows 10, and also under OSX on different Apple MACs. The minimal example is:- Oldterm is a vector of characters, e.g. "A", "B", "A", "*", "B" The regular expression is "\\\\)" The call which freezes R is strsplit(Oldterm, "\\\\)" ) Thomas - after he had reproduced the problem - suggested that I submit it to r-devel. Best wishes.... Chris Triggs [[alternative HTML version deleted]]
FWIW, I tried it on my linux box. The memory use shot through the roof, the system crawled to a halt due to constant swapping, and after a minute or so top showed memory use of 47GB, at which point I killed the R process. On linux at least R is not frozen but the strsplit call gobbles up memory (and does not seem to end) which makes it look like it's frozen. Peter> sessionInfo()R version 3.4.1 Patched (2017-08-11 r73090) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Fedora 26 (Twenty Six) Matrix products: default BLAS: /usr/local/atlas/lib/libtatlas.so LAPACK: /usr/local/lib64/R-3.4.1-patched-atlas-parallel/lib/libRlapack.so locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.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_3.4.1 On Wed, Aug 16, 2017 at 3:31 PM, Chris Triggs <cm.triggs at auckland.ac.nz> wrote:> Hi... > > I have come upon a problem with a regular expression which causes base-R > to freeze. I have reproduced the phenomenon on several machines running R > under Windows 10, and also under OSX on different Apple MACs. > > The minimal example is:- > Oldterm is a vector of characters, e.g. "A", "B", "A", "*", "B" > The regular expression is "\\\\)" > > The call which freezes R is > strsplit(Oldterm, "\\\\)" ) > > Thomas - after he had reproduced the problem - suggested that I submit it > to r-devel. > > Best wishes.... > Chris Triggs > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >[[alternative HTML version deleted]]
Hello, This seems to be serious. RGui.exe, fresh session. I've clicked File > New Script and wrote Oldterm <- c("A", "B", "A", "*", "B") strsplit(Oldterm, "\\\\)" ) Ran each instruction at a time with Ctrl+r and with the strsplit call the system froze. Ctrl+Alt+Del didn't work, I had to go for the power switch button. sessionInfo() R version 3.4.1 (2017-06-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 Matrix products: default locale: [1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252 [3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C [5] LC_TIME=Portuguese_Portugal.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_3.4.1 Rui Barradas Em 16-08-2017 23:31, Chris Triggs escreveu:> Hi... > > I have come upon a problem with a regular expression which causes base-R to freeze. I have reproduced the phenomenon on several machines running R under Windows 10, and also under OSX on different Apple MACs. > > The minimal example is:- > Oldterm is a vector of characters, e.g. "A", "B", "A", "*", "B" > The regular expression is "\\\\)" > > The call which freezes R is > strsplit(Oldterm, "\\\\)" ) > > Thomas - after he had reproduced the problem - suggested that I submit it to r-devel. > > Best wishes.... > Chris Triggs > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
I tried this on a Linux (Ubuntu) server invoking R from the command line and the result was the same, except that I could kill the R session from another terminal window. From: Rui Barradas <ruipbarradas at sapo.pt> To: Chris Triggs <cm.triggs at auckland.ac.nz>; "r-devel at r-project.org" <r-devel at r-project.org> Cc: Thomas Lumley <t.lumley at auckland.ac.nz> Sent: Thursday, 17 August 2017, 17:26 Subject: Re: [Rd] Problem with a regular expression. Hello, This seems to be serious. RGui.exe, fresh session. I've clicked File > New Script and wrote Oldterm <- c("A", "B", "A", "*", "B") strsplit(Oldterm, "\\\\)" ) Ran each instruction at a time with Ctrl+r and with the strsplit call the system froze. Ctrl+Alt+Del didn't work, I had to go for the power switch button. sessionInfo() R version 3.4.1 (2017-06-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 Matrix products: default locale: [1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252 [3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C [5] LC_TIME=Portuguese_Portugal.1252 attached base packages: [1] stats? ? graphics? grDevices utils? ? datasets? methods? base loaded via a namespace (and not attached): [1] compiler_3.4.1 Rui Barradas Em 16-08-2017 23:31, Chris Triggs escreveu:> Hi... > > I have come upon a problem with a regular expression which causes base-R to freeze.? I have reproduced the phenomenon on several machines running R under Windows 10, and also under OSX? on different Apple MACs. > > The minimal example is:- > Oldterm is a vector of characters, e.g. "A", "B", "A", "*", "B" > The regular expression is "\\\\)" > > The call which freezes R is > strsplit(Oldterm, "\\\\)" ) > > Thomas - after he had reproduced the problem - suggested that I submit it to r-devel. > > Best wishes.... >? ? ? ? ? ? Chris Triggs > > > ??? [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel [[alternative HTML version deleted]]