Re: [Rd] regexp bug in very recent r-devel

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Wed, 23 May 2007 07:26:30 +0100 (BST)

Deepayan,

Thanks. One bug fix had tickled another here. grexexpr() is not much used in R and when I wrote a regression suite for grep and friends I was suprised to find that both grepexpr(perl=TRUE) and grexepr(fixed=TRUE) were giving incorrect results in MBCSs (provided multibyte characters were actually involved).

Fixed in r41676.

Brian

On Tue, 22 May 2007, Deepayan Sarkar wrote:

> completion is semi-broken in today's r-devel, and the reason seems to
> be some regular expression changes:
>
>> sessionInfo()
> R version 2.6.0 Under development (unstable) (2007-05-22 r41673)
> i686-pc-linux-gnu
>
> locale:
> [...]
>
> attached base packages:
> [1] "stats" "graphics" "grDevices" "utils" "datasets" "methods"
> [7] "base"

>> regexpr("o", "foo", fixed = TRUE)
> [1] 2
> attr(,"match.length")
> [1] 1
>> gregexpr("o", "foo", fixed = FALSE)
> [[1]]
> [1] 2 3
> attr(,"match.length")
> [1] 1 1
>
>> gregexpr("o", "foo", fixed = TRUE)
>
> *** caught segfault ***
> address 0xc022fdab, cause 'memory not mapped'
>
> Traceback:
> 1: gregexpr("o", "foo", fixed = TRUE)
>
> Possible actions:
> 1: abort (with core dump, if enabled)
> 2: normal R exit
> 3: exit R without saving workspace
> 4: exit R saving workspace
>
> On a different machine, this freezes R for a long time, consuming CPU
> cycles and a lot of memory, before returning an error:
>
>> gregexpr("o", "foobar", fixed = TRUE)
> Error in gregexpr("o", "foobar", fixed = TRUE) :
> negative length vectors are not allowed
>> sessionInfo()
> R version 2.6.0 Under development (unstable) (2007-05-22 r41675)
> x86_64-unknown-linux-gnu
>
> -Deepayan
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed 23 May 2007 - 06:30:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 May 2007 - 06:33:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.