From hpages at fhcrc.org  Thu Jul 16 02:08:20 2009
From: hpages at fhcrc.org (=?ISO-8859-1?Q?Herv=E9_Pag=E8s?=)
Date: Wed, 15 Jul 2009 17:08:20 -0700
Subject: [Rd] Resizing a named vector crashes R with gctorture(TRUE)
In-Reply-To: <20090715013440.v7a1c8r4g0cgksw8@webmail.fhcrc.org>
References: <20090715013440.v7a1c8r4g0cgksw8@webmail.fhcrc.org>
Message-ID: <4A5E6F74.30002@fhcrc.org>

Hi,

   > x <- c(a=10, b=20)
   > length(x) <- 1
   > x
    a
   10

But with gctorture turned on, I get:

   > gctorture(TRUE)
   > x <- c(a=10, b=20)
   > length(x) <- 1
   > x
     a
   "a"   <---- ???

   > x <- c(a=10, b=20)
   > length(x) <- 3

    *** caught segfault ***
   address (nil), cause 'unknown'

   Possible actions:
   1: abort (with core dump, if enabled)
   2: normal R exit
   3: exit R without saving workspace
   4: exit R saving workspace

This seems to have been around for a while (I get this with R 2.10,
2.9 and 2.8). Note that I don't get this with an unnamed vector.

This problem affects the methods package. I found it while
troubleshooting the "Protection stack overflow" I reported earlier
(see https://stat.ethz.ch/pipermail/r-devel/2009-July/054030.html)
but I can't tell yet whether the 2 issues are related or not.

It would be nice to see some reaction from the R developers
about these issues. Thanks in advance!

H.


hpages at fhcrc.org wrote:
> Hi,
> 
>   > gctorture(TRUE)
>   > setGeneric("foo", function(x, y) standardGeneric("foo"))
>   [1] "foo"
>   > setMethod("foo", c("ANY", "ANY"),
>   +   function(x, y) cat("calling foo,ANY,ANY method\n")
>   + )
>   Error: protect(): protection stack overflow
> 
> Sorry this is something I already reported one week ago here
>   https://stat.ethz.ch/pipermail/r-devel/2009-July/053973.html
> but I just had a 2nd look at it and realized that the problem
> can in fact be reproduced out of the .onLoad() hook. So I'm
> reporting it again with a different subject.
> 
> See my sessionInfo() below. Thanks!
> H.
> 
> 
>> sessionInfo()
> R version 2.10.0 Under development (unstable) (2009-06-26 r48837)
> x86_64-unknown-linux-gnu
> 
> locale:
>  [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8
>  [5] LC_MONETARY=C              LC_MESSAGES=en_CA.UTF-8
>  [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Herv? Pag?s

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



[Rd] Resizing a named vector crashes R with gctorture(TRUE)
=?ISO-8859-1?Q?Herv=E9_Pag=E8s?=