There's an issue at,

  http://trac.sagemath.org/sage_trac/ticket/5943

that can fail in different ways, depending on the architecture and amount of memory installed. I'm hoping someone will have a better idea for a doctest, or that there will be consensus that the existing doctests cover the issue.

When we call prime_range(), we do it through pari, which takes an unsigned int. Pari can sometimes help you out by throwing a not-enough-memory error if you request too many primes, but not always.

On a 64-bit system, it's easy to pass a uint that's so large pari will throw the not-enough-memory error. There's already a doctest in #11741[1] (which fixed the issue) for the 64-bit case.

On a 32-bit system, the maximum uint is sometimes enough, but if you have PAE and a lot of RAM, you may not get the error, and you'll OOM eventually.

I tried to add a doctest for the 32-bit case, but just managed to OOM the hawk machine instead since it has PAE and plenty of RAM. Is there anything we can do here? In general it seems difficult to prevent a user from running his box out of memory.


[1] http://trac.sagemath.org/sage_trac/ticket/11741

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to