If I make somewhat less than 50-90 tics the plots goes fine, but above 100-130 tics (yes - that number varies...) all I get is:
If I then locate the temporary gnuplot files:
And open them with wxgnuplot.exe - I can get two results:
Either
1) This with a lot of spaces where the tics should have been:
Or -
2) The plot works just fine
It's seems a bit random - especially when the number of tics goes above 50-90
Beyond 150 tics, it certainly doesn't work !
I have made a small test workbook for wxMaxima. There are also a set of gnuplot-files to test on:
TicsTest.zip (github.com)
I have made a ticket at the wxMaxima:
https://github.com/wxMaxima-developers/wxmaxima/issues/2284
That seems to clearly indicate that the problem is on gnuplot's side and not triggered reliably. "Not reliable" sounds like a memory or thread concurrency bug. A few years ago I would have said that means it being hard-to-hunt down (what still is true). Nowadays I would immediately label it as "potential security issue. Report it to them and tell them to try asan to get a chance of hunting it down."
The earliest gnuplot version I have that works is:
G N U P L O T
Version 6.0 patchlevel 3 last modified 2025-06-07
Copyright (C) 1986-1993, 1998, 2004, 2007-2025
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
immediate help: type "help" (plot window: hit 'h')
Terminal type is now q
The first gnuplot version I have, which has this failure is:
G N U P L O T
Version 6.0 patchlevel 5 last modified 2026-07-28
Copyright (C) 1986-1993, 1998, 2004, 2007-2026
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
immediate help: type "help" (plot window: hit 'h')
Terminal type is now qt
Diff:
Diff:
Diff:
Diff:
Fixed now.
There is no security concern here. The bug was that if a very long (>2048 char) command line is encountered early in a session, the input buffer size may not yet have been extended to hold the full command. This resulted in the command being only partially read, with the result being the error message you see. It also results in the input buffer being extended, so that same command would succeed if issued again. This might be the source of the "not triggered reliably" observation.
When the input buffer requires extension because of a very long command, the program must issue an additional read to load the rest of the command. This "go back and read the rest" step was inadvertantly lost in version 6.0.5 as a side-effect of a fix for a related bug.
Fixed now.
There is no security concern here. The bug was that if a very long (>2048 char) command line is encountered early in a session, the input buffer size may not yet have been extended to hold the full command. This resulted in the command being only partially read, with the result being the error message you see. It also results in the input buffer being extended, so that same command would succeed if issued again. This might be the source of the "not triggered reliably" observation.
When the input buffer requires extension because of a very long command, the program must issue an additional read to load the rest of the command. This "go back and read the rest" step was inadvertantly lost in version 6.0.5 as a side-effect of a fix for a related bug.
With 93a256 applied, one case still fails.
If a line plus its trailing newline exactly fills the buffer,
left <= 1is true even though the whole line was read, so the next line is appended to it.Attached
test.gpshows the issue: line 2 is exactly 2046 characters, and the script stops with"test.gp" line 2: unexpected or unrecognized token: print.Checking for the newline fixed it for me:
You are right. Thanks.
I am using gnuplot from within wxMaxima, who generates the files for gnuplot and calls gnuplot to execute these files. Is this fixed for now ?
When is the fix included in a release that wxMaxima can include with their installations files ?
This particular bug exists only in versions 6.0.5 and 6.0.6. If you need a pre-built release, you could "downgrade" to version 6.0.4 or earlier. If building from source, you could pull from the current git repositories for either version 6.0 or 6.1.
For a work-around that lets you continue using version 6.0.5 or 6.0.6, place the following lines in your system or personal initialization file for gnuplot. See "help initialization" for guidance on where these files are located. Or I suppose there may be a way to tell wxMaxima to add these commands at the front of a gnuplot script. This creates a very long string of comment characters and tells gnuplot to load it. The bug will cause only part of the string to be executed, but it's all one big comment so nothing happens except that the input buffer is expanded to >8K characters. After that the bug will not trigger again unless an even longer command is encountered. If you are worried that 8K is not enough, feel free to adjust the iteration in the do for statement.