[interpolation] crash
Requirements
-
I searched through the issues if the issue already exists
Steps to reproduce
- Open the project attached to #546
- Go to the interpolation curve
- Change Number of points to
3
multiple of data - Recalculate
Expected
No crash.
Observed
It's crashing in GSL's interp.c in
if (x < interp->xmin || x > interp->xmax)
{
GSL_ERROR_VAL("interpolation error", GSL_EDOM, GSL_NAN);
}
which is triggered in XYInterpolationCurvePrivate::recalculateSpecific() in L246.
We need to check why x is outside of the min-max range in this case (seems to be a problem for 3 only, works fine for other values) and how to catch and report GSL errors to the user here instead of running into asserts and crashing. This is already done in some other areas, we need to check interpolation and other algorithms, too. S.a. !450 (merged).
Labplot Version
Debug build 2.10.0-1493-g0b5114ffa
Dec 11 2023, 08:29:16
System: openSUSE Leap 15.4
Locale: English,United States (Decimal point '.', Group separator ','
Number settings: Decimal point '.', Group separator ',', Exponential 'e', Zero digit '0', Percent '%', Positive/Negative sign '+'/'-' (Updated on restart)
Architecture: x86_64-little_endian-lp64
Kernel: linux 5.14.21-150400.24.97-default
C++ Compiler: GNU 12.3.0
C++ Compiler Flags: -fno-operator-names -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Werror=init-self -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -Wall -Wextra -Wundef -Wpointer-arith -Wunreachable-code -Wunused -Wdeprecated-declarations -fno-omit-frame-pointer -fstack-protector -fexceptions -std=c++17 -O2 -Wcast-align -Wswitch-enum -fvisibility=default -pedantic -Wzero-as-null-pointer-constant
Edited by Alexander Semke