Skip to content

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

@rsaporta

Description

@rsaporta

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: [email protected]
# 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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions