[R-SIG-Finance] segfault while running quantstrat
tstoyc at gmail.com
Mon Oct 12 07:10:48 CEST 2015
The example ran fine with v0.9-8.
Thank you for fixing the bug,
> On Oct 11, 2015, at 6:14 PM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote:
> Thanks for sharing your data and code with me off-list. I was able to
> find and fix two possible causes, which you can find here:
> Please see if you can still reproduce the segfault with the latest
> code from GitHub.
> On Fri, Oct 9, 2015 at 6:58 PM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote:
>> Thank you. You're running the latest xts on CRAN, and the rbind C code
>> hasn't been touched in years... so this is likely still an issue in
>> the development version of xts.
>> Unfortunately, this is going to be very hard for me to reproduce
>> without your strategy and data. Would it be possible for you to
>> provide it (off-list, if you prefer)?
>> On Fri, Oct 9, 2015 at 6:46 PM, Tsvetan Stoyanov <tstoyc at gmail.com> wrote:
>>> Just before I run applyStrategy(), I have
>>> R version 3.2.2 (2015-08-14)
>>> Platform: x86_64-apple-darwin13.4.0 (64-bit)
>>> Running under: OS X 10.11 (El Capitan)
>>>  en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>>> attached base packages:
>>>  stats graphics grDevices utils datasets methods base
>>> other attached packages:
>>>  quantstrat_0.9.1687 foreach_1.4.2
>>>  blotter_0.9.1695 PerformanceAnalytics_1.4.3541
>>>  FinancialInstrument_1.2.0 quantmod_0.4-5
>>>  TTR_0.23-0 xts_0.9-7
>>>  zoo_1.7-12
>>> loaded via a namespace (and not attached):
>>>  compiler_3.2.2 tools_3.2.2 codetools_0.2-14 grid_3.2.2
>>>  iterators_1.0.7 lattice_0.20-33
>>> On Oct 9, 2015, at 4:33 PM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote:
>>> On Fri, Oct 9, 2015 at 6:29 PM, Tsvetan Stoyanov <tstoyc at gmail.com> wrote:
>>> While running a simple strategy on 5min data I got a segfault after about 2
>>> years and 7 months, or
>>> 200,000 bars. Is this expected, are these the limits or quantstrat/R?
>>> Segfaults are always bugs, never "expected". In this case, the
>>> problem is in the compiled code in xts:::rbind.xts. Please provide
>>> the output of sessionInfo().
>>> *** caught segfault ***
>>> address 0x119b32000, cause 'memory not mapped'
>>> 1: .External("rbindXts", dup = FALSE, ..., PACKAGE = "xts")
>>> 2: rbind(deparse.level, ...)
>>> 3: rbind(Portfolio$symbols[[Symbol]]$txn, NewTxn)
>>> 4: addTxn(Portfolio = portfolio, Symbol = symbol, TxnDate = txntime,
>>> TxnQty = orderQty, TxnPrice = txnprice, ... = ..., TxnFees = txnfees)
>>> 5: ruleOrderProc(portfolio = portfolio, symbol = symbol, mktdata = mktdata,
>>> timestamp = timestamp, periodicity = freq, curIndex = curIndex, ...)
>>> 6: applyRules(portfolio = portfolio, symbol = symbol, strategy = strategy,
>>> mktdata = mktdata, Dates = NULL, indicators = sret$indicators, signals =
>>> sret$signals, parameters = parameters, ..., path.dep = TRUE, debug =
>>> 7: applyStrategy(strategy.st, portfolio.st)
>>> Possible actions:
>>> 1: abort (with core dump, if enabled)
>>> 2: normal R exit
>>> 3: exit R without saving workspace
>>> 4: exit R saving workspace
>>> R-SIG-Finance at r-project.org mailing list
>>> -- 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.
>>> Joshua Ulrich | about.me/joshuaulrich
>>> FOSS Trading | www.fosstrading.com
>> Joshua Ulrich | about.me/joshuaulrich
>> FOSS Trading | www.fosstrading.com
> Joshua Ulrich | about.me/joshuaulrich
> FOSS Trading | www.fosstrading.com
More information about the R-SIG-Finance