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
sqrt memory leaks #9129
Comments
comment:2
I've run valgrind with a clean startup and quit: http://sage.math.washington.edu/home/rlmill/sage-clean.mem.log and with an execution of the following loop:
http://sage.math.washington.edu/home/rlmill/sage-sqrt.mem.log Of particular importance are lines 18757, 16971, 16915, 16831, etc. (Just search through for "definitely") |
comment:3
thanks Robert, however your file is not accessible (neither from the web nor from sage.math). |
comment:4
Fixed. |
comment:5
with the following code in Sage 4.4.4:
valgrind says:
Does it say something to somebody fluent in Pyrex? |
comment:6
Possibly lost means that the garbage collector is being lazy and is by Python design. You need to look at the line numbers I highlighted in the above files, which are "definitely lost." |
comment:7
Replying to @rlmill:
not quite:
|
comment:8
sorry... jetlag |
comment:9
Replying to @rlmill:
those lines seem to indicate the problem lies in the Singular and/or GINAC interface. Any specialist of those interfaces out there? |
comment:10
Replying to @zimmermann6:
I'm not so sure about this. Let's pick on this particular leak:
On line 3842 of
The calls to
Looks innocent enough...
I really don't see where any of this could be going wrong. I think it has to do with the fast integer creation functions. Sage has a pool of allocated Integer objects. The I think that the experts for this memory pool need to step up to the plate... |
comment:11
I just tried the second leak in 4.6 on OS X 10.6.4 and the results are:
After which I interupted the loop since I concluded the leak was no longer there. Can the person who reported this check it on his own machine? |
comment:12
The first reported memory leak is still there, but note that you don't need the extemely large random integers i the example to expose the leak. All you need is a non square integer. Doing the example only with squares in the interval 2!^400 till 2!^800:
The example using 2 as my favorite non square integer:
|
comment:13
I dived a bit deeper into the source code to see what is actually going on and I found that in the end the symbolic ring sqrt function is the one where things go wrong. It's not the general symbolic ring framework since other symbolic ring functions dont misbehave.
arccos I'm not able to figure out which code get's called from the symbolic ring part on, since the internal working of the symbolic ring is a bit to complex for me.
And new_Expression_from_GEx doesn't have any documentation or whatsoever. |
comment:14
I confirm the second leak seems to be fixed now (tried with Sage 4.6 on Fedora and 4.5.2 on The first one is still present in Sage 4.6. Paul |
comment:15
the problem seems to be in the power function. With Sage 4.6:
Paul |
comment:16
William, Burcin, the memory leaks seems to be in the I guess the Please can you help? Paul |
comment:17
I don't have time to check now, but the http://pynac.sagemath.org/hg/file/b233d9dadcfa/ginac/numeric.cpp#l297 There is nothing that immediately catches my eye there. To experiment, you'll need a pynac development environment: |
comment:18
Sorry for the spam, but is the problem still there with the patch at #8659 applied? |
comment:19
Replying to @burcin:
yes, but the leak seems to be smaller:
instead of Paul |
comment:20
I added some print-statements in
Then it seems that for inexact powers that function is called twice for SR input:
but for exact powers only once:
For Integer input we get:
For ZZ input we get:
In all cases there is no memory leak for exact powers, but there is for inexact powers. Paul |
Changed keywords from none to sd35.5 |
comment:23
Replying to @zimmermann6:
The This should really be tested with the patch at #8659, which eliminates the need to call |
comment:24
I updated the description. Paul PS: it seems the "stopgaps" were deleted, but I don't know which value it was... |
This comment has been minimized.
This comment has been minimized.
comment:39
Feel free to file the upstream bug report faster next time ;-) |
comment:40
the problem is that I had no idea in which upstream component the leak was (or in Sage), and I had no idea how to search where the leak was. If you can give some information how we can do this in similar cases, it would be very helpful. Paul |
Author: Volker Braun |
comment:41
Will be fixed by the pynac update at #14780 |
comment:42
Replying to @zimmermann6:
Fwiw, I used the |
Dependencies: #14780 |
Changed upstream from Reported upstream. No feedback yet. to Fixed upstream, in a later stable release. |
Reviewer: Marc Mezzarobba |
comment:45
could we add a small doctest checking that the leak is gone? Paul |
Branch: u/vbraun/sqrt_memory_leaks |
comment:47
Please review, then. New commits:
|
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:49
lgtm. Paul, please complain if you disagree, since you were the one who asked for a regression test! |
comment:50
I agree, thank you to everybody! |
Changed branch from u/vbraun/sqrt_memory_leaks to |
cf http://groups.google.com/group/sage-support/browse_thread/thread/8c18b2b91004c35a#
Depends on #14780
Upstream: Fixed upstream, in a later stable release.
CC: @robertwb @malb @craigcitro @koffie @williamstein @burcin @jpflori
Component: basic arithmetic
Keywords: sd35.5
Author: Volker Braun
Branch/Commit:
42a4f7f
Reviewer: Marc Mezzarobba
Issue created by migration from https://trac.sagemath.org/ticket/9129
The text was updated successfully, but these errors were encountered: