hi gnuplot4.1 developers,
we ran into this problem of gnuplot4.1 core-dumped
whenever we have mis-spelled/inocrrect command(s) or
syntax error in our gnuplot control file in batch
mode.
i.e. if we run "gnuplot splot.gp" ... gnuplot crashed
with core.
e.g.
--------------------------------------
./gnuplot /tmp/splot.gp
Segmentation fault
--------------------------------------
however, if we run gnuplot in interactive mode,
we see gnuplot catches the error and no crash.
e.g.
----------------------------------------------
gnuplot> load "/tmp/splot.gp"
gnuplot> title "test of gnuplot pm3d and hidden3d "
0.000000,0.000000 font ""
^
"/tmp/splot.gp", line 3: invalid command
gnuplot>
---------------------------------------------------
since we are always doing graphs in batch mode,
we always use the "./gnuplot splot.gp" style to
generate our graphs and hence we got lots of
crashes ...
Incidentically, i also notice another gnuplot crash
case is when the "set output" is writing to a permission
denied lcoation. Again gnuplot only crashes in batch
mode while the interactive mode will inform the user
about the permission problem. Another case was
we mis-spelled "multiplot" as "multplot" and got
gnuplot to crashed too.. (in batch mode).
--------------------------------------------
gnuplot> load "/tmp/splot.gp"
gnuplot> set output 'splot.png'
^
cannot open file; output not changed
"/tmp/splot.gp", line 2: util.c: Permission denied
gnuplot>
---------------------------------------------
Lasttly here is my gnuplot 4.1 environment:
. cvs checkout gnuplot 4.1 on May 5 2005
. compiled gnuplot4.1 with gd-2.0.33 with ttf support
on Solaris (sparc) 5.8, 5.9 and 5.10
. compiled gnuplot4.1 with gd-2.0.33 with ttf support
on Solaris (x86) 5.10.
note: i've verified this crash when run in batch mode
problem on both sparc/x86 Solaris systems.
(Solaris sparc 5.9 and Solaris x86 5.10)
Here is the splot.gp file i used:
--------------------
set terminal png font arial 12 size 640,480
set output 'splot.png'
##
## note: to caused a core in batch mode, remove "set" word
## to cause an incorrectly syntax
set title "test of gnuplot pm3d and hidden3d "
0.000000,0.000000 font ""
set border 4095 lt -1 lw 1.000
set style line 100 linetype 5 linewidth 0.500 pointtype
100 pointsize 1.000
set view 50, 220, 1, 1
set samples 30, 30
set isosamples 30, 30
unset surface
set ticslevel 0
set xrange [ -1.00000 : 1.00000 ] noreverse nowriteback
set yrange [ -1.00000 : 1.00000 ] noreverse nowriteback
set zrange [ -15.0000 : 4.00000 ] noreverse nowriteback
set pm3d at st
set pm3d scansautomatic flush begin noftriangles
nohidden3d solid implicit corners2color mean
splot log(x*x*y*y)
------------------------
thanks and let me know if you need more info...
Wayne Chan
wayne.chan@sun.com
408-404-8588
Logged In: YES
user_id=1090807
I cannot reproduce the crash itselft, but get:
$ gnuplot test.gp
(null)0.000000,0.000000 font ""
^
"test.gp", line 7: invalid command
instead. But this is still annoying. It seems
current_prompt is not set.
With:
===================8<=================
--- util.c.orig 2005-05-20 14:32:46.000000000 +0200
+++ util.c 2005-05-20 14:32:59.000000000 +0200
@@ -66,7 +66,7 @@
/* decimal sign */
char *decimalsign = NULL;
-const char *current_prompt = NULL; /* to be set by
read_line() */
+const char *current_prompt = ""; /* to be set by
read_line() */
/* internal prototypes */
================>8=====================
It works for me.
Juergen
Logged In: YES
user_id=27517
Fixed in CVS, by making the relevant routines NULL-safe.