zhengxwen / gdsfmt

R Interface to CoreArray Genomic Data Structure (GDS) Files (Development version only)
http://www.bioconductor.org/packages/gdsfmt
18 stars 4 forks source link

R crashes if print() is called on a previously deleted node #11

Closed tdeenes closed 9 years ago

tdeenes commented 9 years ago

The call .Call(gdsNodeValid, x) in print.gdsn.class crashes the R session if x is a previously deleted node.

library(gdsmt)
f <- createfn.gds("test.gds")
n <- add.gdsn(f, "vec", 1:10)
delete.gdsn(n, TRUE)
## THIS WILL CRASH YOUR R SESSION!!!
# print(n)
sessionInfo()
# R version 3.2.1 (2015-06-18)
# Platform: x86_64-pc-linux-gnu (64-bit)
# Running under: Linux Mint LMDE
# 
# locale:
#     [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#     [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#     [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#     [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#     [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#     [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#     
# attached base packages:
#     [1] stats     graphics  grDevices utils     datasets  methods   base     
#     
# other attached packages:
#     [1] gdsfmt_1.5.8
# 
# loaded via a namespace (and not attached):
#     [1] tools_3.2.1
zhengxwen commented 9 years ago

Actually, your problem is as the same as the issue #3: print a non-existent GDS node, which was deleted or created by other (forked) process.

I will try to fix this problem before the next release of Bioconductor (Oct).