Data.table: Reproducible Segfault When Loading/Unloading data.table

Created on 18 Dec 2014  ·  10Comments  ·  Source: Rdatatable/data.table

In the R console:

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.1 <- data.table(a=1:10, b=1:10)
detach("package:data.table", character.only=TRUE, unload=TRUE)

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

This is the session info before running the above code:

sessionInfo()
# R version 3.1.1 (2014-07-10)
# Platform: x86_64-apple-darwin13.1.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] stats     graphics  grDevices utils     datasets  methods   base  

This also happens in 1.9.4. In RStudio, segfault doesn't happen right away, but running code multiple times eventually causes it to happen.
Also reproduced with 1.9.4 in R3.1.2 on Win7.64.

bug

Most helpful comment

I tried again with 1.12.8 and this appears to have gone away.

All 10 comments

Thanks for the report. Reproducible. Please make sure you've read the contribution guidelines.

Arun, I did read the contribution guidelines. What did I miss?

Remove the > and comment the output, so that it's easy to copy/paste. I edited yours.

It seems like the bug above was not fixed in 1.9.5:
The code below creates a fatal crash in my fresh R session (after running it multiple times):

library(data.table)
DT = data.table(x=rep(c("a","b","c"),each=3), y=c(1,3,6), v=1:9)
detach("package:data.table", unload=TRUE)

Interestingly, this seems to be ok:

library(data.table)
#DT = data.table(x=rep(c("a","b","c"),each=3), y=c(1,3,6), v=1:9)
detach("package:data.table", unload=TRUE)

Here is my sessionInfo():

R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)

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     

other attached packages:
[1] data.table_1.9.5 devtools_1.8.0  

loaded via a namespace (and not attached):
 [1] httr_1.0.0      R6_2.1.0        magrittr_1.5    rversions_1.0.1 tools_3.2.1     curl_0.9.1          Rcpp_0.12.0    
 [8] memoise_0.2.1   xml2_0.1.1      stringi_0.5-5   knitr_1.10.5    git2r_0.10.1    stringr_1.0.0       digest_0.6.8   
[15] chron_2.3-47  

Same things happen on 1.9.4

Still reproducible in 1.9.6, though we need to add the additional library call at the end.

library(data.table)
dt.1 <- data.table(a=1:10, b=1:10)
detach("package:data.table", character.only=TRUE, unload=TRUE)
library(data.table)

# *** caught segfault ***
# address 0x110eb2300, cause 'memory not mapped'
# 
# Possible actions:
# 1: abort (with core dump, if enabled)
# 2: normal R exit
# 3: exit R without saving workspace
# 4: exit R saving workspace

Cannot reproduce it anymore, must have been fixed in the last 5 years. Checked on Linux. I would appriciate if someone on Windows and Mac could confirm as well if it is fixed.

library(data.table)
#data.table 1.12.9 IN DEVELOPMENT built 2020-04-03 10:50:14 UTC; jan using 1 threads (see ?getDTthreads).  Latest news: r-datatable.com
dt.1 <- data.table(a=1:10, b=1:10)
detach("package:data.table", character.only=TRUE, unload=TRUE)
library(data.table)
#data.table 1.12.9 IN DEVELOPMENT built 2020-04-03 10:50:14 UTC; jan using 1 threads (see ?getDTthreads).  Latest news: r-datatable.com

Still happening on OS X:

R version 3.6.0 (2019-04-26) -- "Planting of a Tree"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

library(data.table)
data.table 1.12.2 using 2 threads (see ?getDTthreads).  Latest news: r-datatable.com
dt.1 <- data.table(a=1:10, b=1:10)
detach("package:data.table", character.only=TRUE, unload=TRUE)
library(data.table)

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

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 

Maybe R version-specific? not happening for me on OSx

> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] C/UTF-8/C/C/C/C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.6.0
> library(data.table)
data.table 1.12.9 IN DEVELOPMENT built 2020-02-20 09:16:40 UTC; travis using 4 threads (see ?getDTthreads).  Latest news: r-datatable.com
**********
This development version of data.table was built more than 4 weeks ago. Please update: data.table::update.dev.pkg()
**********
> data.table 1.12.2 using 2 threads (see ?getDTthreads).  Latest news: r-datatable.com
 エラー:  想定外の数値定数です  in "data.table 1.12"
> dt.1 <- data.table(a=1:10, b=1:10)
> detach("package:data.table", character.only=TRUE, unload=TRUE)
> library(data.table)
data.table 1.12.9 IN DEVELOPMENT built 2020-02-20 09:16:40 UTC; travis using 4 threads (see ?getDTthreads).  Latest news: r-datatable.com
**********
This development version of data.table was built more than 4 weeks ago. Please update: data.table::update.dev.pkg()
**********

I tried again with 1.12.8 and this appears to have gone away.

Nothing particularly stands out to me as a fix for this issue, but anyway, this commit came up from git bisect as the first fixed commit

04eeb304e95f889e9ea4087af741f938b12b26d8

Was this page helpful?
0 / 5 - 0 ratings