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

segfault when comparing a NULL column #2303

Closed
HughParsonage opened this issue Aug 16, 2017 · 4 comments · Fixed by #3455
Closed

segfault when comparing a NULL column #2303

HughParsonage opened this issue Aug 16, 2017 · 4 comments · Fixed by #3455
Labels
Milestone

Comments

@HughParsonage
Copy link
Member

@HughParsonage HughParsonage commented Aug 16, 2017

I experience a segfault when running the below code on Windows, Mac, and Linux. While I've used the unexported data.table:::null.data.table for the minimal reprex, I first encountered the crash when testing a package which Imports data.table.

library(data.table)
# data.table 1.10.5 IN DEVELOPMENT built 2017-08-15 16:41:46 UTC; appveyor
# The fastest way to learn (by data.table authors): https://www.datacamp.com/courses/data-analysis-the-data-table-way
# Documentation: ?data.table, example(data.table) and browseVignettes("data.table")
# Release notes, videos and slides: http://r-datatable.com
# Warning message:
#   package ‘data.table’ was built under R version 3.4.1 
sessionInfo()
# R version 3.4.0 (2017-04-21)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows >= 8 x64 (build 9200)
# 
# Matrix products: default
# 
# locale:
#   [1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    LC_MONETARY=English_Australia.1252
# [4] LC_NUMERIC=C                       LC_TIME=English_Australia.1252    
# 
# attached base packages:
#   [1] stats     graphics  grDevices utils     datasets  methods   base     
# 
# other attached packages:
#   [1] data.table_1.10.5    RevoUtilsMath_10.0.0
# 
# loaded via a namespace (and not attached):
#   [1] compiler_3.4.0   RevoUtils_10.0.4 tools_3.4.0 

x <- NULL
DT <- data.table:::null.data.table()
DT2 <- DT[, .(x)]
DT2[x > 1]

*** caught segfault ***
address (nil), cause 'memory not mapped'
Segmentation fault (core dumped)

@HughParsonage
Copy link
Member Author

@HughParsonage HughParsonage commented Aug 11, 2018

No longer causing a seg.fault.

@st-pasha
Copy link
Contributor

@st-pasha st-pasha commented Aug 11, 2018

Trying on Mac with the DT freshly pulled from master (on R 3.4.2):

> require(data.table)
Loading required package: data.table
data.table 1.11.5 IN DEVELOPMENT built 2018-08-11 01:45:12 UTC; pasha  Latest news: r-datatable.com
> x <- NULL
> DT <- data.table:::null.data.table()
> DT2 <- DT[, .(x)]
> DT2[x > 1]

 *** caught segfault ***
address 0x0, cause 'memory not mapped'

Interestingly that R process continues to spin in the background, consuming 62% CPU. Not sure what it's doing...

@st-pasha st-pasha reopened this Aug 11, 2018
@st-pasha
Copy link
Contributor

@st-pasha st-pasha commented Aug 11, 2018

It fails on line subset.c:317 :

...
copyMostAttrib(x, ans);
...

@HughParsonage
Copy link
Member Author

@HughParsonage HughParsonage commented Aug 11, 2018

OK must be partially an R 3.5 v R 3.4 issue.

@mattdowle mattdowle added this to the 1.12.2 milestone Mar 19, 2019
@mattdowle mattdowle mentioned this issue Mar 20, 2019
8 tasks
mattdowle added a commit that referenced this issue Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants