On Sun, May 24, 2009 at 7:57 PM, Toby HOCKING <toby.hock...@etu.upmc.fr> wrote:
> Yes this is a bizarre error that I had been getting. It was difficult
> to track down
> exactly where the bug came from, but it was somehow related to the C
> stack limit size,
> which was evidently too small and causing the R process to crash ...
> only when used in
> conjunction with RPy and Django (bizarre I know). The workaround that
> I came up with was
> to use the command "ulimit -s unlimited" in the parent shell of every
> python django
> process. Hope this helps.

 I hit this problem at the weekend. It seemed to occur only when
importing rpy from a django view function. So I tried importing rpy
from settings.py, so it happens once at the start of the django run.

 My settings.py starts like this:

from rtest.rshim import myR

 Because for some reason I factored out the rpy import into rshim.py
within an app. It looks like this:

from rpy import r
myR = r

 and then view code that needs rpy does this:

from project.rtest.rshim import myR as r

 I'm not sure if that level of complexity is strictly necessary. I
think the root cause is starting up R from a view which maybe is
running in some odd thread context.

 Maybe this works for you too. I'm on rpy 1.x and R 2.9.x and
django-latest-stable using django's built in server.

 I'm not sure what happens if you get multiple requests, but then
django's test server (I think) blocks on each request. Running from
apache with mod-python? I have no idea... I'd do some serious testing
before making any kind of production system with this. Or possible
move the R business onto a separate server with Rserver.

Barry

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to