Skip to content

reproducible seg fault in assignment by reference #1082

Closed

Description

@stevenbagley

Reproducible seg fault in versions 1.9.4 and 1.9.5:

library(data.table)
# data.table 1.9.5  For help type: ?data.table
# *** NB: by=.EACHI is now explicit. See README to restore previous behaviour.
DT = data.table(x=rep(c("a","b","c"),each=3), y=c(1,3,6), v=1:9)
setkey(DT, x, y)
DT["a", z := NULL][]
# Error in `[.data.table`(DT, "a", `:=`(z, NULL)) : 
#  When deleting columns, i should not be provided
# In addition: Warning message:
# In `[.data.table`(DT, "a", `:=`(z, NULL)) :
#   Adding new column 'z' then assigning NULL (deleting it).
DT["a", z := 42L][]

# *** caught segfault ***
#address 0x300000003, cause 'memory not mapped'

#Traceback:
#1: `[.data.table`(DT, "a", `:=`(z, 42L))
#2: DT["a", `:=`(z, 42L)]
sessionInfo()
# R version 3.1.3 (2015-03-09)
# Platform: x86_64-apple-darwin13.4.0 (64-bit)
# Running under: OS X 10.10.2 (Yosemite)

# 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] stats     graphics  grDevices utils     datasets  methods   base   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions