memory leak in trivial calculation?

35 views
Skip to first unread message

Peter Mueller

unread,
May 27, 2021, 2:20:03 PM5/27/21
to sage-support
The following trivial code eats up all the memory and crashes with an Unhandled SIGSEGV on my Linux machine and sage version 9.3. But it does not work either on the sage cell!

var('z y')
f = -(15*z/(17*y + 11) + 1)*(5*z/(4*y + 1) - 1)*(15*z/(3*y - 4) + 1)
f(y=I)

-- Peter Mueller

Emmanuel Charpentier

unread,
May 28, 2021, 9:37:18 AM5/28/21
to sage-support

Nice one…

Indeed:

sage: f.expand()(y=i)
-(3735/1394*I + 405/1394)*z^3 - (606/697*I - 942/697)*z^2 - (8681/6970*I + 15973/6970)*z + 1
sage: f.partial_fraction(y)(y=i)
-(3735/1394*I + 405/1394)*z^3 - (606/697*I - 942/697)*z^2 - (8681/6970*I + 15973/6970)*z + 1
sage: f.simplify_full()(y=i)
-(3735/1394*I + 405/1394)*z^3 - (606/697*I - 942/697)*z^2 - (8681/6970*I + 15973/6970)*z + 1

all work. But :

sage: f.simplify()(y=i)
``` doesn't return (I didn't wait for it to "eat all memory" and brutally interrupted it with a raft of C-c...).

A serious bug, IMHO (because it can crash Sage in a trivial calculation...).

For once, this isn't a `maxima` bug :

sage: maxima_calculus.interact()

→ Switching to Maxima_lib ←

maxima_lib: subst([y=%i], -(15z/(17y + 11) + 1)(5z/(4y + 1) - 1)(15z/(3y - 4) + 1));
((15z)/(3%i-4)+1)((5z)/(4%i+1)-1)((-(15z)/(17%i+11))-1)
maxima_lib:
→ Exiting back to Sage ←
```

This is now Trac#31869

Reply all
Reply to author
Forward
0 new messages