Skip to content
Prev 36614 / 63421 Next

Possible bug in POSIX classes for R 2.11.0?

To the R development team;

I found an unusual behavior in zoo when I upgraded to R 2.11.0 - it abruptly terminated when I performed certain operations on large zoo objects.  I sent an e-mail to Achim Zeileis and he said this was a potential bug that I should report to the R development team.  The details are given below in the thread below.  Basically, I can crash R with this code:

library(zoo)
x <- runif(140000, 2009, 2010)
x <- as.yearmon(x)
table(x)

This will not crash with a vector of size 130000.

Achim got it to crash with the following code that did not use zoo:

x <- rep(as.Date("1970-01-01"), 140000)
y <- as.POSIXlt(x)
z <- format(y, "%d")

I did find a work around, so this is no longer an immediate problem for me, but it would be better if the problem didn't exist in the first place.  Thank you for your help.

Lester Wollman
Corporate Statistician
Symmetricom, Inc.
Lwollman at symmetricom.com



-----Original Message-----
From: Achim Zeileis [mailto:Achim.Zeileis at uibk.ac.at] 
Sent: Thursday, April 29, 2010 1:16 PM
To: Lester Wollman
Subject: Re: Unusual behavior of zoo and R2.11.0 - simple operation on large zoo object crashes R

Lester,

thanks for the report. The problem does not seem to be in "zoo" but in the 
new POSIX classes and/or their their coercion from "Date".

The following should reproduce your crash:

x <- rep(as.Date("1970-01-01"), 140000)
y <- as.POSIXlt(x)
z <- format(y, "%d")

The reason is probably that R-core changed the internals of all the POSIX 
stuff. Furthermore, this problem appears to be fixed in 2.12.0 (the 
current devel version). Maybe you can ask on R-devel whether this is a 
know issue (my guess is that it is).

Thanks for the report && best wishes,
Z
On Thu, 29 Apr 2010, Lester Wollman wrote: