From maechler at stat.math.ethz.ch  Tue Dec  8 15:35:29 2009
From: maechler at stat.math.ethz.ch (maechler at stat.math.ethz.ch)
Date: Tue,  8 Dec 2009 15:35:29 +0100 (CET)
Subject: [Rd] Crash with Unicode and sub (PR#14114)
Message-ID: <20091208143529.909C1282EF4E@mail.pubhealth.ku.dk>

>>>>> "PD" == Peter Dalgaard <P.Dalgaard at biostat.ku.dk>
>>>>>     on Tue, 08 Dec 2009 11:24:50 +0100 writes:

    PD> g.russell at eos-solutions.com wrote:
    >> Full_Name: George Russell
    >> Version: 2.10.0
    >> OS: Windows XP Version 2002 SP 2
    >> Submission from: (NULL) (217.111.3.131)
    >> 
    >> 
    >> The following typed into R --vanilla induces a crash:
    >> -- cut here --
    >> gctorture()
    >> u <- intToUtf8(c(rep(1e3,1e2),32,c(rep(1e3,1e2))))
    >> v <- rep(u,1e2)
    >> v <- sub(" ","",v)
    >> v %in% ""
    >> -- cut here --
    >> 
    >> sessionInfo() says:
    >> 
    >> -- cut here --
    >> R version 2.10.0 (2009-10-26) 
    >> i386-pc-mingw32 
    >> 
    >> locale:
    >> [1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
    >> [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
    >> [5] LC_TIME=German_Germany.1252    
    >> 
    >> attached base packages:
    >> [1] stats     graphics  grDevices datasets  utils     methods   base
    >> -- cut here --
    >> 
    >> I apologise for not testing this with R-2.10.1 but as far as I can see there are
    >> only source releases available so far, which I am not able to compile.
    >> 

    PD> 2.10.1 RC is available now. Please check. 

I just did, on our
 "Windows Server 2003 R2 \\ Standard x64 edition" 

with 
   > sessionInfo()
   R version 2.10.1 RC (2009-12-06 r50684) 
   i386-pc-mingw32 

   locale:
   [1] LC_COLLATE=German_Switzerland.1252  LC_CTYPE=German_Switzerland.1252   
   [3] LC_MONETARY=German_Switzerland.1252 LC_NUMERIC=C                       
   [5] LC_TIME=German_Switzerland.1252    

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

It does "crash" i.e. you get a popup window about an exception
with a hex code.
And indeed, I don't see a problem in Linux.

Martin Maechler, ETH Zurich

    PD> It does seem to be
    PD> reproducible in the Windows version, or at least it takes a very long
    PD> time, but that means running under Wine on SUSE for me. I don't see the
    PD> effect with the Linux build.

    PD> -- 
    PD> O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
    PD> c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
    PD> (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
    PD> ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907

    PD> ______________________________________________
    PD> R-devel at r-project.org mailing list
    PD> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Crash with Unicode and sub (PR#14114)
maechler at stat.math.ethz.ch