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

Reproducible Segfault when names attribute exceeds number of columns and setting to data.table by changing class #832

Closed
rsaporta opened this issue Sep 27, 2014 · 1 comment
Assignees
Milestone

Comments

@rsaporta
Copy link
Contributor

This reproduced on 1.9.2 and 1.9.3

require(data.table)
x <- matrix(1:9, ncol=3)
setattr(x, "names", paste("V", seq_len(length(x)), sep = ""))
setattr(x, "class", c("data.table", "data.frame"))
x

sessionInfo()
# R version 3.0.2 (2013-09-25)
# Platform: x86_64-apple-darwin10.8.0 (64-bit)
# 
# locale:
# [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
# 
# attached base packages:
# [1] graphics  grDevices datasets  stats     utils     methods   base
# 
# other attached packages:
# [1] data.table_1.9.3 devtools_1.3     sos_1.3-8        brew_1.0-6       XML_3.95-0.2     sendmailR_1.1-2
# [7] base64enc_0.1-1  colorout_1.0-1

# loaded via a namespace (and not attached):
#  [1] digest_0.6.3   evaluate_0.5.1 httr_0.2       memoise_0.1    parallel_3.0.2 plyr_1.8       RCurl_1.95-4.3
#  [8] reshape2_1.2.2 stringr_0.6.2  tools_3.0.2    whisker_0.3-2
# 

packageDescription("data.table")
# Package: data.table
# Version: 1.9.3
# Title: Extension of data.frame
# Author: M Dowle, T Short, S Lianoglou, A Srinivasan with contributions from R Saporta, E Antonyan
# Maintainer: Matt Dowle
# Depends: R (>= 2.14.0)
# Imports: methods, reshape2
# Suggests: chron, ggplot2 (>= 0.9.0), plyr, reshape, testthat (>= 0.4), hexbin, fastmatch, nlme, xts, bit64
# Description: Fast aggregation of large data (e.g. 100GB in RAM), fast ordered joins, fast
#  add/modify/delete of columns by group using no copies at all, list columns and a fast file 
# reader (fread). Offers a natural and flexible syntax, for faster development.
# License: GPL (>= 2)
# URL: http://datatable.r-forge.r-project.org/, http://stackoverflow.com/questions/tagged/data.table
# BugReports: https://github.com/Rdatatable/data.table/issues
# MailingList: datatable-help@lists.r-forge.r-project.org
# ByteCompile: TRUE
# Built: R 3.0.2; x86_64-apple-darwin10.8.0; 2014-09-27 07:17:51 UTC; unix
# -- File: /Library/Frameworks/R.framework/Versions/3.0/Resources/library/data.table/Meta/package.rds
@arunsrinivasan
Copy link
Member

Also have to take care of class(x) = c("data.table", "data.frame") by adding a check in format.data.table.

Added here : 880b884

arunsrinivasan added a commit that referenced this issue Feb 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants