From tomas.kalibera at gmail.com  Tue Aug 22 11:49:36 2017
From: tomas.kalibera at gmail.com (Tomas Kalibera)
Date: Tue, 22 Aug 2017 11:49:36 +0200
Subject: [Rd] Problem with a regular expression.
In-Reply-To: <d6335c46b0554853ba8ae1d8ecf1e949@uni-mainz.de>
References: <65e225958ba74a7dbcf0bc4688387e9d@uxcn13-ogg-c.UoA.auckland.ac.nz>
 <5995451B.5040708@sapo.pt> <1783369282.3222160.1502955902026@mail.yahoo.com>
 <d697b033-1eff-d82a-160d-95f7e718c5aa@gmail.com>
 <d6335c46b0554853ba8ae1d8ecf1e949@uni-mainz.de>
Message-ID: <e458b363-dd2f-ff97-f1f2-098c540df372@gmail.com>

Thanks, I patched the TRE sources in R-devel 73107 and closed the PR.
Tomas

On 08/17/2017 11:06 AM, Wollschlaeger, Daniel wrote:
> The issue seems related to R bug report 15012:
>
> https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15012
>
> As mentioned in the comments there, a pull request to the TRE library has recently been made, but I don't know about its status.
>
> Daniel
>
> ________________________________________
> Von: R-devel <r-devel-bounces at r-project.org> im Auftrag von Tomas Kalibera <tomas.kalibera at gmail.com>
> Gesendet: Donnerstag, 17. August 2017 10:14
> An: r-devel at r-project.org
> Betreff: Re: [Rd] Problem with a regular expression.
>
> The problem is in TRE library, in regcomp, while compiling the regular
> expression.
>
> This is enough to trigger in R (to do this without re-boot: ulimit -v
> 500000 ):
>   > strsplit("", "\\\\)")
>
> To repeat in TRE, one can build TRE from sources and run
>   > ./src/agrep "\\\\)" README.md
>
> Tomas
>
>
> On 08/17/2017 09:45 AM, Moshe Olshansky via R-devel wrote:
>> 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]]
>>
>> ______________________________________________
>> 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
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Problem with a regular expression.
Tomas Kalibera