[R-SIG-Finance] applying na.locf to xts objects sometimes crashes R

Jeff Ryan jeff.a.ryan at gmail.com
Tue Jun 30 21:26:35 CEST 2009


Hi David,

Assuming this is an xts object, it is going to be somewhere in the xts
C code.  That said, I am trying to crash it myself, and can't seem to
do it.

Can you create a sample data set to test this against.  Ideally one
that has the erratic behavior you are seeing.

> x <- .xts(rnorm(1e5), 1:1e5)
> x[sample(1e5,10000)] <- NA
> str(which(is.na(x)))
 int [1:10000] 5 10 16 23 25 27 28 30 33 39 ...

> for(i in 1:10000) na.locf(x)
> system.time(for(i in 1:10000) na.locf(x))
   user  system elapsed
 28.335  13.410  41.805

Can you send me:

str(unclass(x))
and your sessionInfo()

Thanks
Jeff

On Tue, Jun 30, 2009 at 2:07 PM, <davidr at rhotrading.com> wrote:
> I have been having random crashes of R from applying na.locf to xts objects.
>
> Going back after a crash and trying the same line again usually works; then
>
> a later, similar line will crash R again.
>
> Has anyone seen this behavior?
>
>
>
> It is sort of hard to send a minimal example because of the flakiness.
>
>
>
> Sometimes the error Comes up in a Windows message box for MSV C++ Runtime
> Library, saying
>
> ‘Runtime Error!
>
> Program: …\Rgui.exe
>
> This application has requested the Runtime to terminate it in an unusual
> way.
>
> Please contact the application’s support team for more information.’
>
> Then R hangs and has to be killed.
>
> Other times, the error come up in window for Visual Studio Just-In-Time
> Debugger,
>
> saying that an unhandled exception occurred in Rgui.exe [6200].  (or [5468]
> or [7220] or …)
>
> Going to Visual Studio yields Unhandled exception at
>
> 0x6c80b097 [or 0x6c72b532 or …]in Rgui.exe: 0xC0000005: Access violation
> writing location 0x80000000 [or 0x00000043 or …].
>
>
>
> I can try to supply some more info if necessary, but as I said, the same xts
> object will work the next time.
>
> Thanks,
>
> -- David
>
>
>
>> sessionInfo()
>
> R version 2.9.0 (2009-04-17)
>
> i386-pc-mingw32
>
>
>
> locale:
>
> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
> States.1252;LC_MONETARY=English_United
> States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
>
>
>
> attached base packages:
>
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
>
>
> other attached packages:
>
> [1] xts_0.6-5 zoo_1.5-6
>
>
>
> loaded via a namespace (and not attached):
>
> [1] grid_2.9.0      lattice_0.17-25
>
>
>
> This e-mail and any materials attached hereto, including, without
> limitation, all content hereof and thereof (collectively, "Rho Content") are
> confidential and proprietary to Rho Trading Securities, LLC ("Rho") and/or
> its affiliates, and are protected by intellectual property laws.  Without
> the prior written consent of Rho, the Rho Content may not (i) be disclosed
> to any third party or (ii) be reproduced or otherwise used by anyone other
> than current employees of Rho or its affiliates, on behalf of Rho or its
> affiliates.
>
> THE RHO CONTENT IS PROVIDED AS IS, WITHOUT REPRESENTATIONS OR WARRANTIES OF
> ANY KIND.  TO THE MAXIMUM EXTENT PERMISSIBLE UNDER APPLICABLE LAW, RHO
> HEREBY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS AND IMPLIED, RELATING TO
> THE RHO CONTENT, AND NEITHER RHO NOR ANY OF ITS AFFILIATES SHALL IN ANY
> EVENT BE LIABLE FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, INCLUDING, BUT NOT
> LIMITED TO, DIRECT, INDIRECT, CONSEQUENTIAL, SPECIAL AND PUNITIVE DAMAGES,
> LOSS OF PROFITS AND TRADING LOSSES, RESULTING FROM ANY PERSON’S USE OR
> RELIANCE UPON, OR INABILITY TO USE, ANY RHO CONTENT, EVEN IF RHO IS ADVISED
> OF THE POSSIBILITY OF SUCH DAMAGES OR IF SUCH DAMAGES WERE FORESEEABLE.
>



-- 
Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com



More information about the R-SIG-Finance mailing list