3

I am trying to run acast function from the package reshape2 on a large data set, and getting the program crash. I was able to localize this problem:

library(plyr)
n <- 15784000
g <- 1:n
split_indices(g, n) # NOTE for copy/pasters:
                    # this may result in an abort and R exit

I am getting the following error message:

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

Traceback:
 1: .Call("split_indices", group, as.integer(n))
 2: split_indices(g, n)

If I reduce the value of n:

n <- 3946000

then the error message is different:

Error: segfault from C stack overflow

The R system I am using:

> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-unknown-linux-gnu (64-bit)
Package: plyr_1.8

Is this a distribution/build problem? Can it be fixed by appropriate choice of build parameters and how?

rcs
  • 67,191
  • 22
  • 172
  • 153
Dmitry K.
  • 1,145
  • 1
  • 9
  • 16
  • I was under the impression that `split_indices` wasn't an exported function, which would imply that you probably shouldn't be using it anyway. – joran Jan 27 '13 at 15:15
  • 2
    reproducible with plyr_1.8 on Ubuntu 10.04 with 32-bit R Under development (unstable) (2012-12-14 r61321). I would say this *definitely* belongs on https://github.com/hadley/plyr/issues – Ben Bolker Jan 27 '13 at 15:58
  • @joran, `split_indices` does seem to be exported from plyr, at least in version 1.8 ... – Ben Bolker Jan 27 '13 at 16:02
  • @BenBolker You're right, I forgot this computer was running an older version. – joran Jan 27 '13 at 16:11
  • There was a fix to https://github.com/hadley/plyr/blob/master/src/split-numeric.c 3 months ago to stop a different kind of segfault problem. I wonder whether there is some sort of integer overflow problem going on here? – Ben Bolker Jan 27 '13 at 17:30
  • Unrelated comment: Looks like you've deleted your [subclass question](http://stackoverflow.com/questions/25787313/calling-subclasses-from-derived-class-in-python), but I'd like to share my solution: http://ideone.com/B8sXVm I will delete this comment after a while. ;-) – Ashwini Chaudhary Sep 11 '14 at 12:43
  • Whoops! I noticed that issue with your code was the `__class__` call inside class method, so my solution is an overkill I guess. :) – Ashwini Chaudhary Sep 11 '14 at 12:50

0 Answers0