Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[.xts segfaults if numeric or logical j contains NA #97

Closed
IlyaKipnis opened this issue May 21, 2015 · 2 comments
Closed

[.xts segfaults if numeric or logical j contains NA #97

IlyaKipnis opened this issue May 21, 2015 · 2 comments
Assignees
Labels

Comments

@IlyaKipnis
Copy link

A NA in a numeric or logical j will cause a segfault if [.xts is called on an xts object with more than one column.

require(xts)
.xts(1,1)[,NA]  # doesn't crash; error could be more informative though
.xts(t(c(1,1)),1)[,NA]  # crashes
.xts(t(c(1,1)),1)[,c(1,NA)]  # crashes

-Ilya

@joshuaulrich joshuaulrich self-assigned this May 21, 2015
@joshuaulrich joshuaulrich changed the title Segfault! [.xts segfaults if numeric or logical j contains NA May 23, 2015
@joshuaulrich
Copy link
Owner

This worked as of cfafaaa. It looks like the move to _do_subset_xts and extract_col created regression bugs.

.xts(t(c(1,1)),1)[,NA]  # crashes in .Call("extract_col",...)
.xts(t(c(1,1)),1)[1,NA]  # crashes in .Call("_do_subset_xts",...)

@joshuaulrich joshuaulrich added this to the Release 0.10-0 milestone Oct 11, 2015
@joshuaulrich
Copy link
Owner

All 3 issues have been fixed.

  1. The crash caused by .xts(t(c(1,1)),1)[,NA] is fixed in 724660a.
  2. The crash caused by .xts(t(c(1,1)),1)[1,NA] is fixed in fa1c82f.
  3. The error caused by .xts(1,1)[,NA] is fixed in 0cb64b3.

joshuaulrich added a commit that referenced this issue Apr 21, 2017
The errors and crashes in #97 were caused by subsetting an xts object
with a NA j value. They also caused by regressions when the subset C
code was refactored. I should have added test cases when fixing them,
but better late than never.
joshuaulrich added a commit that referenced this issue Apr 21, 2017
The errors and crashes in #97 were caused by subsetting an xts object
with a NA j value. They also caused by regressions when the subset C
code was refactored. I should have added test cases when fixing them,
but better late than never.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants