Originally reported downstream in Gentoo at https://bugs.gentoo.org/811927.
I'm not sure how to understand the error output, so this is the last part of the log, and I've attached the output in full. Let me know if I can provide more useful debugging information.
<cr> to continuemake[3]: *** [Makefile:730: check-noninteractive] Error 139
make[3]: Leaving directory '/var/tmp/portage/sci-visualization/gnuplot-5.4.2/work/gnuplot-5.4.2/demo'
make[2]: *** [Makefile:585: check-am] Error 2
make[2]: Leaving directory '/var/tmp/portage/sci-visualization/gnuplot-5.4.2/work/gnuplot-5.4.2/demo'
make[1]: *** [Makefile:435: check-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/sci-visualization/gnuplot-5.4.2/work/gnuplot-5.4.2/demo'
make: *** [Makefile:429: check-recursive] Error 1
* ERROR: sci-visualization/gnuplot-5.4.2::gentoo failed (test phase):
* emake failed
Thanks for the error report.
Unfortunately there is really no useful information in the build log, other than showing which demo script was in progress when something caused the run to stop. Can you run that one demo again under gdb and/or valgrind? E.g.
That runs here with no errors reported, but I don't have an arm system to test it on. If it fails for you, then the content of valgrind.log may be informative.
Possibly the same bug as #2450 "Segfault on s390x with 5.4.1 during docs build"?
https://sourceforge.net/p/gnuplot/bugs/2450/
That one also is not reproducible on x86, and the failure shown in the valgrind out is in the same code that is exercised by the isosurface demo.
Thanks for the quick reply!
Yeah, I felt a bit guilty even submitting it, but I was struggling to get more information out because I'm quite new to gnuplot.
I was able to run that one demo again and it segfaulted outside of Portage (the package manager) which is good. Iv'e also got a backtrace:
I've attached the 'bt full' output too. It does seem to be the same function as in https://sourceforge.net/p/gnuplot/bugs/2450/ (and the same line?). BTW, I do have access to s390 (and could probably give you access too if it would be helpful to s390 or some other exotic arches), so let me know if I can do something there as well.
I might be doing Valgrind wrong but this is what I get:
Last edit: Sam James 2021-10-17
That valgrind log seems to indicate it segfaulted before it even got to run the program. Does it do the same thing if you use some other innocuous demo like 'arrows.dem'?
I will stare at the ASAN output and see if I can make any sense of it. It does look like the same thing as the earlier s390 report.
AddressSanitizer has given the following:
I have a hypothesis that the issue is not the platform per se (little/big endian) but the compiler behavior when making a signed test against a (static const char) variable promoted to (int).
If you can do so, would you please test the attached patch for the source files marching_cubes.h and qt_table.h? It explicitly declares these static tables as (static signed char) rather than (static char).
Last edit: Ethan Merritt 2021-10-17
The patch works! That test no longer segfaults. Let me try the whole test suite now.
I suspect this is because char defaults to unsigned on arm? I'm a little bit surprised this didn't fail at compile time.. I've seen this sort of failure before in e.g. xmrig (https://github.com/xmrig/xmrig/issues/2527).
EDIT: Oh, duh, I see now. C isn't C++ and it's just going to wrap around for us.
Last edit: Sam James 2021-10-18
All tests passed!
Yes, defaulting to "unsigned char" was the issue. I am surprised that there were not compiler warnings both from testing for negative values and for initializing values to -1.
The fix is commit a2359efd for the development version, and will be included in 5.4.3