Skip to content

Lisp error attempting to display expression with ratio and multi-line string #4204

@rtoy

Description

@rtoy

Imported from SourceForge on 2024-07-09 20:03:08
Created by robert_dodier on 2023-12-29 05:30:55
Original: https://sourceforge.net/p/maxima/bugs/4234


Attempting to print the following expression provokes a Lisp error in the 2-d pretty printer code.

linel: 79 $
abcde(abcdefghi:false,jklmnopqrstuvwxyz:false,
      abcdefghijklmnopq((x+1)/(x+2),"x + 1
----- 
x + 2
"))$
print (_) $

triggers

  Invalid index -1 for (SIMPLE-VECTOR
                        80), should be a non-negative integer below 80.

A stack trace shows that is coming from DRAW-LINEAR in src/displa.lisp.

Note that the error is avoided if linel is larger:

linel: 140 $
abcde(abcdefghi:false,jklmnopqrstuvwxyz:false,
      abcdefghijklmnopq((x+1)/(x+2),"x + 1
----- 
x + 2
"))$
print (_) $

yields

                                                                      x + 1
abcde(abcdefghi : false, jklmnopqrstuvwxyz : false, abcdefghijklmnopq(-----, x + 1
                                                                      x + 2
----- 
x + 2
)) 

Observed with commit 08584e3 and other recent builds. I didn't investigate whether older versions also show the bug or not; that would be interesting to know.

Possibly related to https://sourceforge.net/p/maxima/bugs/4105/ .

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions