Segfault with rWishart in R 2.15.1
On Jul 4, 2012, at 03:12 , Michael Braun wrote:
I just upgraded to R 2.15.1, and I am getting a segmentation fault when using the rWishart function (from the stats package) to sample moderately-size matrices. Here is the output when I run R within gdb. 720 appears to be the dimensionality cut-off. Anything smaller works fine. Anything larger crashes.
x=rWishart(1,700,diag(700)) // this works x=rWishart(1,720,diag(720))
Error: C stack usage is too close to the limit
x=rWishart(1,722,diag(722))
That'll be due to allocating memory off the C stack with alloca(). Please file a bug report on this (nothing to do with Mac, much less with the age of your computer). In a tight spot, you can run R from the terminal after raising the C stack limit with, say, "ulimit -s 32768", but of course the trouble returns at twice the matrix size. Notice that there are really two issues here. One is that the R_CheckStack() safeguards are failing. The other is why we're using stack allocation in the first place.
Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com