 |
Forums |
Admin Start New Thread
By: ben woodcroft
RE: segfault in RSRuby [ reply ] 2009-12-10 22:53
|
Hi Alex,
Thanks for the reply. Versions:
1968MB RAM
Ubuntu karmic
R version 2.9.2 (2009-08-24)
rsruby (0.5.1.1)
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
I notice that running this code directly in R does not give me problems (it gives me a big matrix).
Thanks,
ben
|
By: Alex Gutteridge
RE: segfault in RSRuby [ reply ] 2009-12-07 10:14
|
Thanks Ben,
That's interesting. As you probably know, the first call to matrix you tried creates a 2941x5332 sized matrix (filled with 656) which is big, but shouldn't crash R and doesn't crash RSRuby on my machine so something more subtle than simply running out of memory is going on. RSRuby should never segfault but there's obviously a bug somewhere with memory allocation. Could you let me know what R/RSRuby/Ruby versions this was with?
AlexG
|
By: ben woodcroft
segfault in RSRuby [ reply ] 2009-12-07 04:02
|
Hi all,
For a while I've gotten occasional segfaults when running rsruby, which is obviously frustrating, and they haven't been the easiest things to track down. However, I've managed to track one down today so I thought I'd share my experience. I'm not sure if this should be fixed in rsruby somehow (assuming someone has time), but here it is anyhow.
The following script gives me a segfault:
require 'rubygems'
require 'rsruby'
r = RSRuby.instance
r.matrix.autoconvert(RSRuby::NO_CONVERSION)
matrix = r.matrix(656,2941,5332,18860)
r.fisher_test(matrix)
Output (after a few seconds of waiting):
*** caught segfault ***
address 0xe9e5f038, cause 'memory not mapped'
I realised that the third line was the problem - I was incorrectly using the matrix function - it should have been
matrix = r.matrix([656,2941,5332,18860],:nr => 2)
After changing my code to something correct, it worked as I was expecting.
Thanks,
ben
|
|
 |