This bug was discovered by Claude Opus 5.5 and reproduced on Maxima Git commit c62924c (2026-09-26) with SBCL 2.2.9.
Where: src/plot.lisp, CHECK-OPTION-PALETTE
CHECK-OPTION-PALETTE checks a hard-coded list #$[value,0.2,0,0,10]$ instead of the palette given. So the documented rule that the first three numbers lie in [0,1], followed by a fourth number, is never enforced, and [value,0.2] later makes GNUPLOT-PALETTE add NIL to a number.
src/plot.lisp as described under "Fix".tests/rtest_plotoptions.mac, at the end of the file.make check, or run_testsuite(share_tests=true); in ./maxima-local), and check that the change breaks no test. Failures that also occur without the change (a run on the unchanged build shows which) are pre-existing and can be ignored.* \#5481 hue, saturation and value palettes are not checked; a bad one gives a Lisp error when plotting to ChangeLog, under "Bug fixes for numbered bugs:".Fixed by commit [1a2b3c]., with the first six characters of the commit's SHA in the brackets (git rev-parse HEAD | cut -c1-6 prints them). SourceForge links this to the commit.set_plot_option([palette,[hue,7,-3,12,10]]); plot3d(x*y,[x,0,1],[y,0,1],[palette,[value,0.2]],[plot_format,gnuplot],[run_viewer,false],[gnuplot_script_file,"/tmp/b28.gp"]);
Before the fix:
the first palette is accepted; the plot3d call gives: Maxima encountered a Lisp error: The value NIL is not of type NUMBER
Correct result:
Maxima errors from the option check (Expecting a number between 0 and 1 found 7.0; Wrong number of arguments for plot option value)
In src/plot.lisp (CHECK-OPTION-PALETTE, line "(check-option (butlast (cdr #$[value,0.2,0,0,10]$))"), replace
(check-option (butlast (cdr #$[value,0.2,0,0,10]$))
with
(check-option (butlast (cdr palette))
Add these lines to tests/rtest_plotoptions.mac, separated from the tests before them by two empty lines:
/* Bug #5481: "hue, saturation and value palettes are not checked; a bad one gives a Lisp error when plotting" */
block ([r],
reset_plot_options (),
r: [errcatch (set_plot_option ([palette, [hue, 7, -3, 12, 10]])),
errcatch (set_plot_option ([palette, [value, 0.2]])),
(set_plot_option ([palette, [hue, 0.25, 0.7, 0.8, 0.5]]),
get_plot_option (palette))],
set_plot_option ([palette, default]),
reset_plot_options (),
r);
[[], [], [palette, hue, 0.25, 0.7, 0.8, 0.5]]$
plot.lisp: check hue, saturation and value palettes
CHECK-OPTION-PALETTE checked the constant list [value, 0.2, 0, 0, 10]
instead of the palette given, so a hue, saturation or value palette with
numbers outside [0, 1] or with too few numbers was accepted and later
caused a Lisp error when plotting. Check the palette given.
This fixes bug #5481.
Found and fixed by Claude Opus 5.5.
Diff: