[Rd] writing to gzfile: segmentation fault (PR#2347)

Dirk Eddelbuettel edd@debian.org
Thu Dec 5 03:41:05 2002


On Thu, Dec 05, 2002 at 01:30:19AM +0100, vograno@arbitrade.com wrote:
> Full_Name: Vadim Ogranovich
> Version: Version 1.6.0  (2002-10-01)
> OS: Red Hat 7.1
> Submission from: (NULL) (209.99.241.1)
> 
> 
> The following sequence of commands crashes my R session. The first weirdness
> happens after the second command that appears not to change the "foo.gz" file,
> no error generated.
> 
> > con <- gzfile("foo.gz", open="w"); cat("goo\n", file=con); close(con)
> con <- gzfile("foo.gz", open="w"); cat("goo\n", file=con); close(con)
> > cat("boo\n", file=gzfile("foo.gz"))
> # this doesn't change "foo.gz"
> cat("boo\n", file=gzfile("foo.gz"))
> > con <- gzfile("foo.gz", open="w"); cat("goo\n", file=con); close(con)
> con <- gzfile("foo.gz", open="w"); cat("goo\n", file=con); close(con)
> > cat("boo\n", file=gzfile("foo.gz"))
> cat("boo\n", file=gzfile("foo.gz"))
> 
> Process R segmentation fault at Wed Dec  4 16:13:32 2002

Try upgrading -- 1.6.1 on Debian is happy:

edd@chibud:~> R

R : Copyright 2002, The R Development Core Team
Version 1.6.1  (2002-11-01)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type license()' or licence()' for distribution details.

R is a collaborative project with many contributors.
Type contributors()' for more information.

Type demo()' for some demos, help()' for on-line help, or
help.start()' for a HTML browser interface to help.
Type q()' to quit R.

> con <- gzfile("foo.gz", open="w"); cat("goo\n", file=con); close(con)
> cat("boo\n", file=gzfile("foo.gz"))
> con <- gzfile("foo.gz", open="w"); cat("goo\n", file=con); close(con)
> cat("boo\n", file=gzfile("foo.gz"))
> ls()
[1] "con"

Dirk

-- 
Prediction is very difficult, especially about the future. 
				             -- Niels Bohr