Gnuplot crashes when it is invoked with a command such as gnuplot -c script.gpi 1 2
. This happens with gnuplot 5.4.3 on Windows 10, in cmd.exe.
Steps to reproduce the bug:
Create this file, named script.gpi
:
print('start') print(ARG0) print(ARG1) print(ARG2) print('end')
Do gnuplot -c script.gpi
. The expected output is
start script.gpi end
but instead gnuplot crashes and does not output anything.
Do gnuplot -c script.gpi 1
. The output matches the expected output:
start script.gpi 1 end
No issue here.
Do gnuplot -c script.gpi 1 2
. The expected output is
start script.gpi 1 2 end
but instead gnuplot crashes and does not output anything.
I'm not seeing a crash under linux, but valgrind shows a read from uninitialized memory that may explain it. The attached patch prevents that, and hopefully it also fixes your crash.
In the current development source in which the above patch applied,
still crashes.
I tried make with debug symbol and tried execute through gdb.
I made break point in misc,c however program seems to seg faults very early stage.
Last edit: Tatsuro MATSUOKA 2022-02-11
The index for the call arguments gets one too large which is causing the segfault. Fixed in master.
I have confirmed the fix in the master branch. Commit [d78e63]
Related
Commit: [d78e63]