Hi Mark,

R-forge svn version 534

The issue was when calling to_period (internal replacement for to.period
code - eventually replacing to.period) on a 1 column object, when the one
column was also TRUE for has.Ad(x).  Essentially improperly allocating the
resultant object - and hence the segfault.

New version should be making its way to CRAN soon.

Thanks,
Jeff

On Tue, Nov 2, 2010 at 11:26 AM, Mark Breman <breman.mark@gmail.com> wrote:

> Hi,
>
> After installing the latest packages from R-forge for R 2.12.0, quantmod
> crashes with a segmentation fault:
>
> ############################### start log
> #######################################
> > library(quantmod)
> Loading required package: Defaults
> Loading required package: xts
> Loading required package: zoo
> Loading required package: TTR
> > library(fGarch)
> Loading required package: timeDate
> Loading required package: timeSeries
>
> Attaching package: 'timeSeries'
>
> The following object(s) are masked from 'package:zoo':
>
>    time<-
>
> Loading required package: fBasics
> Loading required package: MASS
>
> Attaching package: 'fBasics'
>
> The following object(s) are masked from 'package:TTR':
>
>    volatility
>
> The following object(s) are masked from 'package:base':
>
>    norm
>
> >
> > #Get data:
> > from <- as.Date('01/01/2000', format = '%m/%d/%Y')
> > to <- as.Date(Sys.Date() - 1, format = '%m/%d/%y')
> > DAX <- getSymbols('^GDAXI', from = from, to = to, auto.assign=F)
> > rets <- dailyReturn(Ad(DAX), type="log")
>
>  *** caught segfault ***
> address 0x3f010008, cause 'memory not mapped'
>
> Traceback:
>  1: to_period(x, period = on.opts[[period]], ...)
>  2: inherits(x, "data.frame")
>  3: is.data.frame(x)
>  4: colnames(x)
>  5: grep("Close", colnames(x), ignore.case = TRUE)
>  6: has.Cl(x)
>  7: Cl(to_period(x, period = on.opts[[period]], ...))
>  8: inherits(x, "xts")
>  9: is.xts(x)
> 10: try.xts(x1, error = FALSE)
> 11: Delt_(Cl(to_period(x, period = on.opts[[period]], ...)), type = type)
> 12: periodReturn(x, "daily", subset, type, leading, ...)
> 13: dailyReturn(Ad(DAX), type = "log")
>
> Possible actions:
> 1: abort (with core dump, if enabled)
> 2: normal R exit
> 3: exit R without saving workspace
> 4: exit R saving workspace
> ########################################### end log
> ###########################################
>
> I'm running R 2.12.0 on linux. Here's my environment:
>
> > sessionInfo()
> R version 2.12.0 (2010-10-15)
> Platform: i486-pc-linux-gnu (32-bit)
>
> locale:
>  [1] LC_CTYPE=en_US.utf8       LC_NUMERIC=C              LC_TIME=en_US.utf8
>       LC_COLLATE=en_US.utf8     LC_MONETARY=C
>  [6] LC_MESSAGES=en_US.utf8    LC_PAPER=en_US.utf8       LC_NAME=C
>      LC_ADDRESS=C              LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
>  [1] fGarch_2110.80     fBasics_2110.79    MASS_7.3-7
> timeSeries_2130.90 timeDate_2130.91   quantmod_0.3-14    TTR_0.20-2
>  [8] xts_0.7-6.1        zoo_1.7-0          Defaults_1.1-1
>
> loaded via a namespace (and not attached):
> [1] grid_2.12.0     lattice_0.19-13
>
> Anyone else having the same problems?
>
> Regards,
>
> -Mark-
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>



-- 
Jeffrey Ryan
jeff.a.ryan@gmail.com

	[[alternative HTML version deleted]]

