[datatable-help] .SD segmentation fault.

George Gui guizhida at gmail.com
Thu Sep 3 19:58:20 CEST 2015


Hi,

I had a memory bug when I tried to run the following script that wants to
select a subset rows of data.table, the bug is somehow fixed by making a
copy of the input data.table however:

library(data.table)

load('test_bug.RData')

Test.Bug <- function(tmp_move, ID){
  print(ID)
  #tmp_move <- copy(tmp_move)
  coverage <- tmp_move[, .(c.count= sum(dummy== 0)), by= group]
  groups_selected <- unique(coverage[c.count>120, group])
  tmp_move2 <- tmp_move[group %in% groups_selected]
  return(tmp_move2)
}

move[, Test.Bug(.SD, ID), by= ID]


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

Traceback:
 1: bmerge(i, x, leftcols, rightcols, io <- FALSE, xo, roll = 0,
rollends = c(FALSE, FALSE), nomatch = 0L, verbose = verbose)
 2: `[.data.table`(tmp_move, group %in% groups_selected)
 3: tmp_move[group %in% groups_selected]
 4: Test.Bug(.SD, ID)
 5: `[.data.table`(move, , Test.Bug(.SD, ID), by = ID)
 6: move[, Test.Bug(.SD, ID), by = ID]


-- 
Zhida(George) Gui
Mathematics and Economics Major
Email:guizhida at gmail.com
Cell:773-614-2597
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20150903/91fb66f0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_bug.R
Type: application/octet-stream
Size: 358 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20150903/91fb66f0/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_bug.RData
Type: application/octet-stream
Size: 2113 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20150903/91fb66f0/attachment-0001.obj>


More information about the datatable-help mailing list