Menu ▾ ▴

#3224 radcan(sqrt(-1/(1+%i))) exhausts heap

None
closed
nobody
None
5
2026-06-10
2016-09-27
No

I have been investigating some algsys failures. [bugs:#1266] is the failure of algsys to find a solution to [x^2+x+1=0,x^2*y+1=0].

While debugging I triggered the following.

(%i3) j:sqrt(-1/(sqrt(3)*%i+1))$
(%i4) radcan(j);
Heap exhausted during garbage collection: 0 bytes available, 8 requested.

The advice from the mailing list on a similar issue [bugs:#3223] was that algsys wasn't intended for nested squareroots.
https://sourceforge.net/p/maxima/mailman/message/35391566/

Just noting this for future reference.

(%i1) build_info();
Maxima version: "5.36.1"
Maxima build date: "2015-05-02 08:52:44"
Host type: "i686-pc-mingw32"
Lisp implementation type: "SBCL"
Lisp implementation version: "1.2.7"

Related

Bugs: #1266
Bugs: #3223
Bugs: #3224

Discussion

  • Stavros Macrakis

    Though radcan doesn't perform any root denesting, no Maxima function should ever core-dump.

    Radcan handles this case fine with algebraic:true , giving the same result as ratsimp:

    radcan(j),algebraic => sqrt(sqrt(3)*%i-1)/2
    

    (reproduced on Maxima branch_5_37_base_528_g802ae7f using Lisp SBCL 1.2.11)

     
    • David Billinghurst

      Thanks. radcan with algebraic:true shows some promise. more testing
      required.

      On 29/09/2016 00:40, Stavros Macrakis wrote:

      Though radcan doesn't perform any root denesting, /no/ Maxima function
      should ever core-dump.

      Radcan handles this case fine with algebraic:true , giving the same
      result as ratsimp:

      radcan(j),algebraic => sqrt(sqrt(3)*%i-1)/2

      (reproduced on Maxima branch_5_37_base_528_g802ae7f using Lisp SBCL
      1.2.11)


      [bugs:#3224] https://sourceforge.net/p/maxima/bugs/3224/
      radcan(nested squareroot) exhausts heap

      Status: open
      Group: None
      Created: Tue Sep 27, 2016 06:44 AM UTC by David Billinghurst
      Last Updated: Tue Sep 27, 2016 06:46 AM UTC
      Owner: nobody

      I have been investigating some algsys failures. [bugs:#1266]
      https://sourceforge.net/p/maxima/bugs/1266/ is the failure of algsys
      to find a solution to [x^2+x+1=0,x^2*y+1=0].

      While debugging I triggered the following.

      (%i3) j:sqrt(-1/(sqrt(3)*%i+1))$
      (%i4) radcan(j);
      Heap exhausted during garbage collection: 0 bytes available, 8 requested.

      The advice from the mailing list on a similar issue [bugs:#3223]
      https://sourceforge.net/p/maxima/bugs/3223/ was that algsys wasn't
      intended for nested squareroots.
      https://sourceforge.net/p/maxima/mailman/message/35391566/

      Just noting this for future reference.

      (%i1) build_info();
      Maxima version: "5.36.1"
      Maxima build date: "2015-05-02 08:52:44"
      Host type: "i686-pc-mingw32"
      Lisp implementation type: "SBCL"
      Lisp implementation version: "1.2.7"


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/maxima/bugs/3224/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #1266
      Bugs: #3223
      Bugs: #3224

  • Stavros Macrakis

    The nested root is a red herring. Here is a simpler case that core dumps:

       radcan(sqrt(-1/(1+%i)))
    

    Things seem to go wrong somewhere in the everysubst00 routine.

    Tested in Maxima branch_5_37_base_528_g802ae7f using Lisp SBCL 1.2.11

     
  • Stavros Macrakis

    • summary: radcan(nested squareroot) exhausts heap --> radcan(sqrt(-1/(1+%i))) exhausts heap
     
  • David Billinghurst

    Commits [2986fc] and [640ca7] avoid the calls to radcan from algsys, so the original problem is resolved. Doesn't fix the core dump.

     

    Related

    Commit: [2986fc]
    Commit: [640ca7]

  • David Scherfgen

    David Scherfgen - 2026-06-10
    • status: open --> closed
     
  • David Scherfgen

    David Scherfgen - 2026-06-10

    The crash no longer occurs, closing this ticket.

     

Log in to post a comment.