Skip to content

[patch] Error in reg-tests-1c.R (R-devel)

6 messages · Mikko Korpela, Berwin A Turlach, Martin Maechler

#
I get an error when running "make check" after building R-devel r70629 
on Ubuntu 14.04. Here are the relevant lines in the file 
"reg-tests-1c.Rout.fail":

   > ## m1z uses match(x, *) with length(x) == 1 and failed in R 3.3.0
   > ## PR#16909 - a consequence of the match() bug; check here too:
   > dv <- data.frame(var?1 = 1:3, var?2 = 3); dv[,"var?2"] <- 2
   Error: unexpected input in "dv <- data.frame(var<C3>"
   Execution halted

The attached patch uses escape sequences for all non-ASCII characters in 
this test and performs pretty much the same check as the original 
version, as far as I know. This fixes "make check" for me. The patched 
check fails on R 3.3.0 as it should.

Here is the output of "locale":

   LANG=en_GB
   LANGUAGE=en_GB:
   LC_CTYPE=fi_FI.UTF-8
   LC_NUMERIC="en_GB"
   LC_TIME="en_GB"
   LC_COLLATE="en_GB"
   LC_MONETARY=fi_FI.UTF-8
   LC_MESSAGES="en_GB"
   LC_PAPER="en_GB"
   LC_NAME="en_GB"
   LC_ADDRESS="en_GB"
   LC_TELEPHONE="en_GB"
   LC_MEASUREMENT="en_GB"
   LC_IDENTIFICATION="en_GB"
   LC_ALL=
#
> I get an error when running "make check" after building
    > R-devel r70629 on Ubuntu 14.04. 
    > Here are the relevant
    > lines in the file "reg-tests-1c.Rout.fail":

    >    > ## m1z uses match(x, *) with length(x) == 1 and failed in R 3.3.0
    >    > ## PR#16909 - a consequence of the match() bug; check here too:
    >    > dv <- data.frame(var?1 = 1:3, var?2 = 3); dv[,"var?2"] <- 2
    >    Error: unexpected input in "dv <- data.frame(var<C3>"
    >    Execution halted

    > The attached patch uses escape sequences for all non-ASCII characters in 
    > this test and performs pretty much the same check as the original 
    > version, as far as I know. This fixes "make check" for me. The patched 
    > check fails on R 3.3.0 as it should.

Thank you, Mikko!

This is ..hmm.. "interesting".  We have a few other non-ASCII characters
in a few of the tests/*.R  files  and they don't seem to harm
your checks; even  reg-tests-1c.R  contains some.

Also, the "Installation and Administration" R Manual mentions
that some of the tests only run flawlessly if you are not using
"unusual" locales.  So I am a bit puzzled that exactly this
(new) test fails in your locale, but the others did not.

However, as I said, thank you indeed for diagnosing the problem and
providing a patch working around it (and still checking the
intended problem !!).
I'm applying the patch now ... so you'd continue to be one of
our valuable pre-alpha/beta testers.

With best regards,
Martin


    > Here is the output of "locale":

    >    LANG=en_GB
    >    LANGUAGE=en_GB:
    >    LC_CTYPE=fi_FI.UTF-8
    >    LC_NUMERIC="en_GB"
    >    LC_TIME="en_GB"
    >    LC_COLLATE="en_GB"
    >    LC_MONETARY=fi_FI.UTF-8
    >    LC_MESSAGES="en_GB"
    >    LC_PAPER="en_GB"
    >    LC_NAME="en_GB"
    >    LC_ADDRESS="en_GB"
    >    LC_TELEPHONE="en_GB"
    >    LC_MEASUREMENT="en_GB"
    >    LC_IDENTIFICATION="en_GB"
    >    LC_ALL=

    > -- 
    > Mikko Korpela
    > Department of Geosciences and Geography
    > University of Helsinki
#
G'day Martin,

On Wed, 18 May 2016 12:50:21 +0200
Martin Maechler <maechler at stat.math.ethz.ch> wrote:

            
[...]
[...]

Well, my nightly script had also failed to complete due to the same
problem.  But I usually wait a day or two before reporting such a problem, 
in the hope that the problem sorts itself out. :)

But to confirm this issue:
	
* My (bash) script sets:
	export LANG=en_AU.UTF-8
* The crontab entry that runs it is:
	44 5 * * * cd /opt/src ; /usr/bin/xvfb-run ./R-aop-Doit
* The relevant part of reg-tests-1c.Rout.fail says:

	> ## m1z uses match(x, *) with length(x) == 1 and failed in R 3.3.0 
	> ## PR#16909 - a consequence of the match() bug; check here too:
	> dv <- data.frame(var?1 = 1:3, var?2 = 3); dv[,"var?2"] <- 2
	Error: unexpected input in "dv <- data.frame(var?"
	Execution halted

Cheers,

	Berwin
#
On 18/05/16 13:50, Martin Maechler wrote:
My quick check indicates that this was the only test with non-ASCII 
characters in argument names. That might be the crucial difference.

- Mikko
#

        
> On 18/05/16 13:50, Martin Maechler wrote:
>>>>>>> Mikko Korpela <mikko.korpela at helsinki.fi> on Wed, 18
    >>>>>>> May 2016 13:05:24 +0300 writes:
    >> 
    >> > I get an error when running "make check" after building
    >> > R-devel r70629 on Ubuntu 14.04.  > Here are the
    >> relevant > lines in the file "reg-tests-1c.Rout.fail":
    >> 
    >> > > ## m1z uses match(x, *) with length(x) == 1 and
    >> failed in R 3.3.0 > > ## PR#16909 - a consequence of the
    >> match() bug; check here too: > > dv <- data.frame(var?1 =
    >> 1:3, var?2 = 3); dv[,"var?2"] <- 2 > Error: unexpected
    >> input in "dv <- data.frame(var<C3>" > Execution halted
    >> 
    >> > The attached patch uses escape sequences for all
    >> non-ASCII characters in > this test and performs pretty
    >> much the same check as the original > version, as far as
    >> I know. This fixes "make check" for me. The patched >
    >> check fails on R 3.3.0 as it should.
    >> 
    >> Thank you, Mikko!
    >> 
    >> This is ..hmm.. "interesting".  We have a few other
    >> non-ASCII characters in a few of the tests/*.R files and
    >> they don't seem to harm your checks; even reg-tests-1c.R
    >> contains some.
    >> 
    >> Also, the "Installation and Administration" R Manual
    >> mentions that some of the tests only run flawlessly if
    >> you are not using "unusual" locales.  So I am a bit
    >> puzzled that exactly this (new) test fails in your
    >> locale, but the others did not.

    > My quick check indicates that this was the only test with
    > non-ASCII characters in argument names. That might be the
    > crucial difference.

very good point, Mikko, thank you!
Indeed that error happens at *parse* time ... whereas using such
character in strings is considerably less problematic.

What are the results of my fix  (R-devel svn rev >= 70631)  ?

Martin


    >> 
    >> However, as I said, thank you indeed for diagnosing the
    >> problem and providing a patch working around it (and
    >> still checking the intended problem !!).  I'm applying
    >> the patch now ... so you'd continue to be one of our
    >> valuable pre-alpha/beta testers.
    >> 
    >> With best regards, Martin
    >> 
    >> 
    >> > Here is the output of "locale":
    >> 
    >> > LANG=en_GB > LANGUAGE=en_GB: > LC_CTYPE=fi_FI.UTF-8 >
    >> LC_NUMERIC="en_GB" > LC_TIME="en_GB" > LC_COLLATE="en_GB"
    >> > LC_MONETARY=fi_FI.UTF-8 > LC_MESSAGES="en_GB" >
    >> LC_PAPER="en_GB" > LC_NAME="en_GB" > LC_ADDRESS="en_GB" >
    >> LC_TELEPHONE="en_GB" > LC_MEASUREMENT="en_GB" >
    >> LC_IDENTIFICATION="en_GB" > LC_ALL=
    >> 
    >> > --
    >> > Mikko Korpela > Department of Geosciences and Geography
    >> > University of Helsinki
    >>
#
[.....	  ]

    MM> What are the results of my fix (R-devel svn rev >= 70631) ?

Nonsense question! This is for another R-devel thread (where it
has been answered).  Sorry about the noise.

Martin