Hi Greg,

I get a different error on my mac:

> for (i in 1:10000) {
+  try({z=textConnection(NULL,open='w')
+  for (j in 1:100) {
+    write(runif(1)*1e6,file=z)
+    write('\n',file=z)
+  }
+  close(z)})
+ }
Error : cannot set length of non-vector
In addition: Warning message:
closing unused connection 3 (NULL)
Error: no function to return from, jumping to top level
In addition: Warning message:
closing unused connection 3 (NULL)
Error : Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'character'
Error : cannot set length of non-vector
Error : cannot set length of non-vector
Error : cannot set length of non-vector
Error: no function to return from, jumping to top level
In addition: Warning messages:
1: closing unused connection 7 (NULL)
2: closing unused connection 6 (NULL)
3: closing unused connection 5 (NULL)
4: closing unused connection 4 (NULL)
Error : cannot set length of non-vector
Error : cannot set length of non-vector
In addition: Warning message:
closing unused connection 5 (NULL)
Error: no function to return from, jumping to top level
In addition: Warning message:
closing unused connection 5 (NULL)
Error : SET_STRING_ELT() can only be applied to a 'character vector', not a
'integer'
Error: no function to return from, jumping to top level
In addition: Warning message:
closing unused connection 6 (NULL)
Error : cannot set length of non-vector
Error : Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'character'
In addition: Warning message:
closing unused connection 7 (NULL)
Error : cannot set length of non-vector

whence I ^C out of the loop.

> sessionInfo()
R version 2.7.0 Patched (2008-04-28 r45540)
i386-apple-darwin8.10.1

locale:
C

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

On Tue, Apr 29, 2008 at 2:52 PM, Gregoire Pau <[EMAIL PROTECTED]> wrote:

> Dear all,
>
> It seems that textConnection() can trigger a segmentation fault. The
> following script (using two large loops) makes this bug reproducible:
>
> for (i in 1:10000) {
>  z=textConnection(NULL,open='w')
>  for (j in 1:100) {
>    write(runif(1)*1e6,file=z)
>    write('\n',file=z)
>  }
>  close(z)
> }
>
> The bug could be reproduced on R-2.6.1, R-2.7.0 and on the latest R-devel
> 2008-04-29 r45543.
> Here are some sessionInfo() details:
> *----*
> R version 2.6.1 (2007-11-26)
> x86_64-unknown-linux-gnu
>
> locale:
>
> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> *----*
> R version 2.7.0 (2008-04-22)
> x86_64-unknown-linux-gnu
>
> locale:
>
> LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices datasets  utils     methods   base
> *----*
> R version 2.8.0 Under development (unstable) (2008-04-29 r45543)
> x86_64-unknown-linux-gnu
>
> locale:
>
> LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices datasets  utils     methods   base
>
> Greg
> ---
> Gregoire Pau
> EMBL/EBI Cambridge, UK
> http://www.ebi.ac.uk/~gpau <http://www.ebi.ac.uk/%7Egpau>
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

        [[alternative HTML version deleted]]

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

Reply via email to