New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sage 3.4.2.a0: len(prime_range(2^50)) segfaults #5943
Comments
comment:1
Hmm, the back trace looks pretty bad:
|
comment:2
I can't get this to segfault. I tried on sage.math and on my laptop (macbook running 32-bit archlinux). The problem is that the two machines get different answers after a while (I hope the table is clear -- the last column is a function that's "known" to be a good approximation to prime_pi):
So it seems that the problem starts somewhere between |
This comment has been minimized.
This comment has been minimized.
comment:4
We might want to either implement this ourselves or just put reasonable limit on this:
|
comment:6
I get now (in sage 4.2.1)
which is the same problem as #7017. |
comment:7
In Sage 4.7.2.alpha3, I get the following:
Is there something wrong with this, or should this ticket be closed? |
Patch doctesting the correct behaviour |
comment:8
Attachment: sage-trac_5943-doctest.patch.gz I think the current behavior is desirable given the alternatives. |
Author: Michael Orlitzky |
This comment has been minimized.
This comment has been minimized.
comment:9
Sounds good to me. |
Reviewer: Keshav Kini |
Merged: sage-4.8.alpha5 |
Changed merged from sage-4.8.alpha5 to none |
comment:11
On hawk (OpenSolaris 06.2009-32):
|
comment:12
Hmm. For comparison, on x86_64, within a doctest:
What's
Maybe the doctest should test a specific number to avoid vagaries of various platforms? Or maybe we should dig around in the code to find out why there are two different code paths that run out of memory in this operation with two different error messages. |
comment:13
Sorry, the sys.maxint was (apparently not so) carefully chosen to prevent an overflow error on 32-bit systems (see #11741 and #7017). My reasoning was that it should also be large enough to cause the not-enough-memory error on any 32-bit system, but I've been outsmarted. It looks like Pari actually created a list of |
comment:14
Replying to @kini:
|
comment:15
On 32-bit machines with PAE and a lot of memory, I think that trying to test for the not-enough-memory condition here on x32 is probably doomed. The patch for #11741 has the right idea: on 64-bit machines, we know that we can't compute close to The actual bug is still fixed: you get python errors instead of segfaults now. That leaves only the question of whether #11741 is a sufficient doctest. |
Changed reviewer from Keshav Kini to Keshav Kini, Volker Braun |
This comment has been minimized.
This comment has been minimized.
comment:19
Or did you mean the doctest from #11741 is not sufficient? |
comment:20
#11741 is sufficient, as I wrote in the ticket description. |
Changed author from Michael Orlitzky to none |
Changed reviewer from Keshav Kini, Volker Braun to Michael Orlitzky, Keshav Kini, Volker Braun |
This ticket used to be about prime_pi() segfaulting, but due to a mixup of versions used and switching to a new algorithm in 3.4.2.a0 the cause is the following:
Alex's comments are about the old ticket. This problem with wrong results has been moved to #5963.
Cheers,
Michael
Fixed in #11741.
CC: @boothby @orlitzky
Component: number theory
Reviewer: Michael Orlitzky, Keshav Kini, Volker Braun
Issue created by migration from https://trac.sagemath.org/ticket/5943
The text was updated successfully, but these errors were encountered: