Re: Segfault loading draw.lisp (GCL b ackend) — draw2d/draw3d/gr2d unusable on Debia n/Ubuntu-packaged Maxima 5.49.0

Robert Dodier <[email protected]>
Newsgroups gmane.comp.mathematics.maxima.general
Message-ID <CAAsY_sRkrFx3Rm3Bu0AFa49Q8auJpeNFV9pbJdSx9ZSakfesJw@mail.gmail.com>
Hi Jean-Michel, thanks for the bug report.

The way it is supposed to work is that the draw package (and others
like it) is compiled once for each Maxima version and cached in
~/.maxima/binary, and then those binary files are loaded for the
second and any later times.

The draw package is compiled and loaded by a program, similar to
`make`, called defsystem. The makefile analogue is draw.system and it
is found in the folder share/draw somewhere in the Maxima
installation.

As a workaround, I find that I can change (mk:oos "draw" :compile) to
(mk:oos "draw" :load) and then defsystem does not try to compile the
code and instead just loads the .lisp files instead, so that the code
is interpreted instead of compiled and executed. (Barring bugs in the
Lisp interpreter and/or compiler, which are rare but not impossible,
the observable behavior should be identical from the user's point of
view.)

I find that after I make that change, then load("draw") provokes some
questions from defsystem, which I answered to tell defsystem not to
compile the Lisp files, as follows:

$ sh maxima-local
Maxima branch_5_49_base_881_ga887ed816 https://maxima.sourceforge.io
using Lisp SBCL 2.1.0
[...]
(%i1) load ("draw");
;    - Binary file
/Users/dodier/sourceforge/maxima-code/binary/branch_5_49_base_881_ga887ed816/sbcl/2_1_0/share/draw/grcommon.fasl
is old or does not exist.
;      Compile (and load) source file
/Users/dodier/sourceforge/maxima-code/share/draw/grcommon.lisp
instead? n

;    - Should I bother you if this happens again? n

;    - Should I compile while loading the system? n

;    - Binary file
/Users/dodier/sourceforge/maxima-code/binary/branch_5_49_base_881_ga887ed816/sbcl/2_1_0/share/draw/grcommon.fasl
does not exist.
;      Load source file
/Users/dodier/sourceforge/maxima-code/share/draw/grcommon.lisp
instead? y

;    - Should I bother you if this happens again? n
(%o1)
/Users/dodier/sourceforge/maxima-code/share/draw/draw.lisp

After that it looks like draw2d works as expected.

I find the questions annoying but not really a problem.

To avoid defsystem altogether, you can just load the Lisp files one by
one; draw.system shows there are just a few:

load ("grcommon.lisp");
load ("gnuplot.lisp");
load ("vtk.lisp");
load ("picture.lisp");

Although you were saying you don't want to switch Lisp
implementations, I would recommend that you reconsider -- my advice is
to work with SBCL + Maxima instead. There has just been a Maxima 5.50
release -- my advice is to compile it from source code. Maxima is
compiled with a conventional configure / make / make install cycle. I
can say more if you are interested.

Hope this helps, and thanks for your interest in Maxima.

Robert
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.