In Debian we have found that the documentation compilation on the platform mipsel fails with the segmentation fault:
GNUPLOT_LIB=../../../demo gdb --args ../src/gnuplot -e "winhelp=1;" ../../../docs/plotstyles.gnu
GDB:
Starting program: /home/gladk/04/gnuplot-5.2.7+dfsg1/debian/build-x11/src/gnuplot -e winhelp=1\; ../../../docs/plotstyles.gnu
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/mipsel-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
[34m0x5557a1fc[m in [33mpolar_to_xy[m ([36mtheta[m=0, [36mr[m=3, [36mx[m=0x7fff42a0, [36my[m=0x7fff42a8, [36mupdate[m=true) at [32m../../../src/axis.c[m:2752
2752 } else if (r >= R_AXIS.min) {
#0 [34m0x5557a1fc[m in [33mpolar_to_xy[m (theta=0, r=3, x=0x7fff42a0, y=0x7fff42a8, update=true) at [32m../../../src/axis.c[m:2752
#1 [34m0x555ed8a4[m in [33meval_plots[m () at [32m../../../src/plot2d.c[m:3187
#2 [34m0x555867d0[m in [33mplot_command[m () at [32m../../../src/command.c[m:1850
#3 [34m0x55589330[m in [33mcommand[m () at [32m../../../src/command.c[m:629
#4 [34m0x55589330[m in [33mdo_line[m () at [32m../../../src/command.c[m:419
#5 [34m0x555d2e08[m in [33mload_file[m (fp=0x55743150, name=<optimized out>, calltype=<optimized out>) at [32m../../../src/misc.c[m:449
#6 [34m0x5557405c[m in [33mmain[m (argc=1, argv=0x7fff4630) at [32m../../../src/plot.c[m:661
#0 [34m0x5557a1fc[m in [33mpolar_to_xy[m (theta=0, r=3, x=0x7fff42a0, y=0x7fff42a8, update=true) at [32m../../../src/axis.c[m:2752
status = INRANGE
#1 [34m0x555ed8a4[m in [33meval_plots[m () at [32m../../../src/plot2d.c[m:3187
y = 0
theta = 0
x = 0
temp = 3
a = {type = CMPLX, v = {int_val = 0, cmplx_val = {real = 3, imag = 0}, string_val = 0x0, data_array = 0x0, value_array = 0x0}}
t = 0
at_ptr = 0x55a45cf8
name_str = <optimized out>
sample_range_token = 0
t_min = 0
t_max = 6.2831853071795862
t_step = 0.063466518254339258
i = 0
this_plot = <optimized out>
tp_ptr = <optimized out>
uses_axis = {(unknown: 0), USES_AXIS_FOR_FUNC, USES_AXIS_FOR_FUNC, (unknown: 0), (unknown: 0), (unknown: 0), (unknown: 0), (unknown: 0), (unknown: 0), (unknown: 1996234272), (unknown: 0)}
some_functions = true
some_tables = false
plot_num = 1
line_num = <optimized out>
was_definition = false
pattern_num = 0
xtitle = 0x0
begin_token = 1
start_token = 1
end_token = <optimized out>
orig_dummy_var = "t\000sU\000\000\000\000\232\\vU\000\377\276c\001\000\000\000\000\000sU\234\363rU\240rmUH\\vUQ\000\000\000\231\\vU\200\363rU(ev"
nbins = 0
binlow = <optimized out>
binhigh = <optimized out>
binwidth = <optimized out>
[m newhist_start = <optimized out>
histogram_sequence = -1
newhist_color = <optimized out>
newhist_pattern = -5
#2 [34m0x555867d0[m in [33mplot_command[m () at [32m../../../src/command.c[m:1850
#3 [34m0x55589330[m in [33mcommand[m () at [32m../../../src/command.c[m:629
inlptr = <optimized out>
#4 [34m0x55589330[m in [33mdo_line[m () at [32m../../../src/command.c[m:419
inlptr = <optimized out>
#5 [34m0x555d2e08[m in [33mload_file[m (fp=0x55743150, name=<optimized out>, calltype=<optimized out>) at [32m../../../src/misc.c[m:449
len = 94
start = <optimized out>
left = <optimized out>
more = <optimized out>
stop = <optimized out>
gpval_lineno = 0x5576ac38
#6 [34m0x5557405c[m in [33mmain[m (argc=1, argv=0x7fff4630) at [32m../../../src/plot.c[m:661
i = <optimized out>
This trace does not make sense to me.
The code lines highlighted are:
R_AXIS is a static global structure that has been accessed repeatedly in the immediately preceding code, so I don't see any way it could cause a segfault here. r is a parameter to this routine so I would expect it to be on the stack (but I don't know mipsel compiler calling conventions so maybe not). Could the compiler somehow be setting a read-only flag that prevents modifying a local parameter?
Last edit: Ethan Merritt 2019-09-04
Does this problem also manifest when building the pdf documentation?
The subject line of this report seems to imply that the error was encountered while trying to build the html documentation. The html output is, I believe, still used for the Windows help system. But this is not expected to work on linux, though of course a segfault is always bad and may indicate a more general problem. It used to be that linux html documentation was produced indirectly via "makeinfo --html", but support for texinfo/makeinfo as a build target was dropped from the main gnuplot package long ago. There is still a makefile rule for "make html" that tries to use latex2html, but this has never worked correctly for me and is not enabled by default.
Exactly the same is happening with pdf-generation. I assume that it can be a bug in newer compiler version.
Acknowledged as a bug in gcc 9.something rather than in the gnuplot code.