Sage: Ticket #4181: [with patch, positive review] Singular/omalloc: do use the system's malloc
https://trac.sagemath.org/ticket/4181
<p>
On both my Mac OS X 10.4 / Xcode 25 boxes, one Intel and one PPC, the following Sage code runs through fine (hit return twice):
</p>
<pre class="wiki">sage: for p in prime_range(32768, 100000): EllipticCurve(GF(p),[0,1,1,10,13])
</pre><p>
Please note that the length of the interval is almost 70000, so quite some primes are involved.
But if the startpoint of the range is lower the 32768, then Sage crashes, e.g. for:
</p>
<pre class="wiki">sage: for p in prime_range(31300, 32600): EllipticCurve(GF(p),[0,1,1,10,13])
</pre><p>
(note that the length of the interval is only 1300) one gets the following message with sage crashed:
</p>
<pre class="wiki">error: no more memory
System 8672k:8672k Appl 8233k/438k Malloc 4030k/33k Valloc 4608k/404k Pages 1071/81 Regions 9:9
halt 14
</pre><p>
The problem/bug can't be due to low physical RAM, or due to not enough virtual RAM for processes, since then the first line of code would have to crash, too. Which is not the case.
</p>
<p>
It is not related to the mathematical code, since if the length of the interval of primes is only 100 or less, the code runs fine for startpoints above and (!) below 32768.
</p>
<p>
The bug is triggered also if consecutively several small intervals (below 32768) are calculated, so it seems to be some caching / stack / heap / whatsoever related issue.
It does not seem to occur on platforms other than Mac (OS X 10.4 only?), so I put this under the "porting" issues.
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/4181
Trac 1.1.6mabshoffTue, 23 Sep 2008 22:30:27 GMTdescription changed
https://trac.sagemath.org/ticket/4181#comment:1
https://trac.sagemath.org/ticket/4181#comment:1
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/4181?action=diff&version=1">diff</a>)
</li>
</ul>
TicketmabshoffTue, 23 Sep 2008 22:42:52 GMT
https://trac.sagemath.org/ticket/4181#comment:2
https://trac.sagemath.org/ticket/4181#comment:2
<p>
As expected nothing bad happen under valgrind on 64 bit, but I will take a closer look with valgrind running on a 32 bit Linux box. It seems too much of a coincidence to not be related to something close to <code>2^15-1</code> or thereabout.
</p>
<p>
Cheers,
</p>
<p>
Michael
</p>
TicketGeorgSWeberSat, 15 Nov 2008 22:03:38 GMT
https://trac.sagemath.org/ticket/4181#comment:3
https://trac.sagemath.org/ticket/4181#comment:3
<p>
Just for the record: once tis ticket is fixed, most probably <a class="closed ticket" href="https://trac.sagemath.org/ticket/3760" title="defect: creating 666 rings in singular fails with an out of memory error on ... (closed: fixed)">#3760</a> will be resolved, too.
</p>
TicketGeorgSWeberSun, 22 Feb 2009 22:06:58 GMTattachment set
https://trac.sagemath.org/ticket/4181
https://trac.sagemath.org/ticket/4181
<ul>
<li><strong>attachment</strong>
set to <em>trac-4181.patch</em>
</li>
</ul>
<p>
relies on <a class="closed ticket" href="https://trac.sagemath.org/ticket/5344" title="defect: [with patch, positive review] Singular/omalloc "double free" problem (closed: fixed)">#5344</a>, apply after this patch after the patch there (to Singular spkg)
</p>
TicketGeorgSWeberSun, 22 Feb 2009 22:13:25 GMTpriority, milestone, summary changed
https://trac.sagemath.org/ticket/4181#comment:4
https://trac.sagemath.org/ticket/4181#comment:4
<ul>
<li><strong>priority</strong>
changed from <em>major</em> to <em>blocker</em>
</li>
<li><strong>milestone</strong>
changed from <em>sage-3.4.1</em> to <em>sage-3.4</em>
</li>
<li><strong>summary</strong>
changed from <em>Mysterious error somewhat related to 16-Bit signed integers on Mac OS X</em> to <em>[with patch, needs review] Singular/omalloc: do use the system's malloc</em>
</li>
</ul>
<p>
Well, what shall I say: apply the two patches (the one from <a class="closed ticket" href="https://trac.sagemath.org/ticket/5344" title="defect: [with patch, positive review] Singular/omalloc "double free" problem (closed: fixed)">#5344</a> and this one), and the long standing "long" doctest for "ell_finite_field.py" now succeeds on sage 3.3, finally:
</p>
<pre class="wiki">sage -t -long "local/lib/python/site-packages/sage/schemes/elliptic_curves/ell_finite_field.py"
[53.9 s]
----------------------------------------------------------------------
All tests passed!
Total time for all tests: 53.9 seconds
</pre><p>
I'll test 666 rings (<a class="closed ticket" href="https://trac.sagemath.org/ticket/3760" title="defect: creating 666 rings in singular fails with an out of memory error on ... (closed: fixed)">#3760</a>) in a minute.
</p>
<p>
Cheers, gsw
</p>
TicketmabshoffSun, 22 Feb 2009 22:26:27 GMTpriority, status, milestone, summary changed; resolution set
https://trac.sagemath.org/ticket/4181#comment:5
https://trac.sagemath.org/ticket/4181#comment:5
<ul>
<li><strong>priority</strong>
changed from <em>blocker</em> to <em>major</em>
</li>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>milestone</strong>
changed from <em>sage-3.4</em> to <em>sage-duplicate/invalid/wontfix</em>
</li>
<li><strong>resolution</strong>
set to <em>duplicate</em>
</li>
<li><strong>summary</strong>
changed from <em>[with patch, needs review] Singular/omalloc: do use the system's malloc</em> to <em>[with patch, needs work] Singular/omalloc: do use the system's malloc</em>
</li>
</ul>
<p>
This will not work and has been tried before. Please do not repurpose tickets since this is not what this ticket is about, but open a new one in case the Singular.spkg needs to be changed. You did that at <a class="closed ticket" href="https://trac.sagemath.org/ticket/5344" title="defect: [with patch, positive review] Singular/omalloc "double free" problem (closed: fixed)">#5344</a>, but then why change the subject of this ticket?
</p>
<p>
In general this is a dupe of <a class="closed ticket" href="https://trac.sagemath.org/ticket/3760" title="defect: creating 666 rings in singular fails with an out of memory error on ... (closed: fixed)">#3760</a>, so I am closing this as one :)
</p>
<p>
If you want a less messy ticket to switch to using
</p>
<p>
Cheers,
</p>
<p>
Michael
</p>
TicketGeorgSWeberMon, 23 Feb 2009 08:15:20 GMT
https://trac.sagemath.org/ticket/4181#comment:6
https://trac.sagemath.org/ticket/4181#comment:6
<p>
Sure, let's close dupes.
</p>
TicketmabshoffMon, 23 Feb 2009 08:46:58 GMT
https://trac.sagemath.org/ticket/4181#comment:7
https://trac.sagemath.org/ticket/4181#comment:7
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/4181#comment:6" title="Comment 6">GeorgSWeber</a>:
</p>
<blockquote class="citation">
<p>
Sure, let's close dupes.
</p>
</blockquote>
<p>
Absolutely.
</p>
<p>
For the record: It only became clear two or maybe three days ago that all these problems on OSX were related to libSingular+mmap, so back in the day when this ticket was opened it was the correct way to do so.
</p>
<p>
Too bad this path series is being held up by the minpoly bug, but I am hoping someone will fix that issue soon, too.
</p>
<p>
Cheers,
</p>
<p>
Michael
</p>
TicketmabshoffMon, 23 Feb 2009 14:50:26 GMT
https://trac.sagemath.org/ticket/4181#comment:8
https://trac.sagemath.org/ticket/4181#comment:8
<p>
Hmm, we might need this patch after all, so we can either attach it to another ticket, i.e. <a class="closed ticket" href="https://trac.sagemath.org/ticket/3760" title="defect: creating 666 rings in singular fails with an out of memory error on ... (closed: fixed)">#3760</a>, or close that one as a dupe and reopen this one. I will test this patch now on a 32 bit OSX box, so let's wait and see for now.
</p>
<p>
The whole issue is spread out over too many tickets and has gotten pretty messy, so let's try to get this resolved :)
</p>
<p>
Cheers,
</p>
<p>
Michale
</p>
TicketmabshoffMon, 23 Feb 2009 18:46:17 GMTpriority, component, milestone changed
https://trac.sagemath.org/ticket/4181#comment:9
https://trac.sagemath.org/ticket/4181#comment:9
<ul>
<li><strong>priority</strong>
changed from <em>major</em> to <em>blocker</em>
</li>
<li><strong>component</strong>
changed from <em>porting</em> to <em>packages</em>
</li>
<li><strong>milestone</strong>
changed from <em>sage-duplicate/invalid/wontfix</em> to <em>sage-3.4</em>
</li>
</ul>
<p>
Ok, reopened and made a blocker against 3.4 again. I am now quite confident we will merge this :)
</p>
<p>
Cheers,
</p>
<p>
Michael
</p>
TicketmabshoffMon, 23 Feb 2009 22:47:57 GMTstatus, summary changed; resolution deleted
https://trac.sagemath.org/ticket/4181#comment:10
https://trac.sagemath.org/ticket/4181#comment:10
<ul>
<li><strong>status</strong>
changed from <em>closed</em> to <em>reopened</em>
</li>
<li><strong>resolution</strong>
<em>duplicate</em> deleted
</li>
<li><strong>summary</strong>
changed from <em>[with patch, needs work] Singular/omalloc: do use the system's malloc</em> to <em>[with patch, positive review] Singular/omalloc: do use the system's malloc</em>
</li>
</ul>
<p>
Positive review. Build on OSX 32 bit, OSX 64 bit, FC 10 and also sage.math. I did valgrind the *entire* test suite on sage.math.
</p>
<p>
George's patch is integrated into
</p>
<p>
<a class="ext-link" href="http://sage.math.washington.edu/home/mabshoff/SPKG/singular-3-0-4-4-20080711.p4.spkg"><span class="icon"></span>http://sage.math.washington.edu/home/mabshoff/SPKG/singular-3-0-4-4-20080711.p4.spkg</a>
</p>
<p>
Cheers,
</p>
<p>
Michael
</p>
TicketmabshoffTue, 24 Feb 2009 19:38:08 GMTstatus changed; resolution set
https://trac.sagemath.org/ticket/4181#comment:11
https://trac.sagemath.org/ticket/4181#comment:11
<ul>
<li><strong>status</strong>
changed from <em>reopened</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
<p>
Merged in Sage 3.4.alpha0.
</p>
<p>
Cheers,
</p>
<p>
Michael
</p>
Ticket