-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 2.8.0: Test fails when building with GCC 13 #563
Comments
That's odd — algo27 should be Can you run it in a debugger and get a stacktrace? |
I tried running ( Can try |
Yes this is it:
I managed to get a backtrace, but I do not know how useful this is:
|
Thanks, it's failing at this line: nlopt/src/algs/newuoa/newuoa.c Line 184 in 58995c2
where nlopt/src/algs/newuoa/newuoa.c Line 1859 in 58995c2
which is passed in from the nlopt/src/algs/newuoa/newuoa.c Line 2575 in 58995c2
(gotta love these f2c-translated Fortran codes). I added a printf("DEBUG: iw = %d, n = %d, len = %d\n",
id, n, ((npt+13)*(npt+n) + 3*(n*(n+3))/2)); right before the
which indicates that plenty of space has been allocated (we are looking at 2 elements right in the middle of a length-141 array diff --git a/src/algs/newuoa/newuoa.c b/src/algs/newuoa/newuoa.c
index a3428a6..e82be63 100644
--- a/src/algs/newuoa/newuoa.c
+++ b/src/algs/newuoa/newuoa.c
@@ -181,6 +181,7 @@ static nlopt_result trsapp_(int *n, int *npt, double *xopt,
if (sub[j] < 0) sub[j] = 0;
xtol[j] = 1e-7 * *delta; /* absolute x tolerance */
}
+ printf("DEBUG 2: &step[1] = %p, n = %d\n", &step[1], *n);
memset(&step[1], 0, sizeof(double) * *n);
opt = nlopt_create(NLOPT_LD_MMA, *n);
nlopt_set_min_objective(opt, quad_model, &qmd);
@@ -2564,6 +2565,9 @@ nlopt_result newuoa(int n, int npt, double *x,
if (!w) return NLOPT_OUT_OF_MEMORY;
--w;
+
+ printf("DEBUG 1: &w[id] = %p, n = %d\n", &w[id], n);
+
/* The above settings provide a partition of W for subroutine NEWUOB. */
/* The partition requires the first NPT*(NPT+N)+5*N*(N+3)/2 elements of */
/* W plus the space that is needed by the last array of NEWUOB. */ As I said, I can't reproduce this problem with gcc 14 and |
Crashes with GCC 14 too, unfortunately. Perhaps you could try compiling with the following additional GCC flags used by default on openSUSE during compilation to see if you can reproduce the issue:
In case it helps, here is a full log for the failing build: _log.zip |
Managed to narrow it down to the use of |
It's possible that In particular, in order to implement 1-based indexing in C code, f2c takes all of the array pointers and decrements them by 1 at the beginning of each function — that's why you'll see lines like In which case you should just turn off the (If |
All right, I built the package using 2 instead of 3 for |
Similar error on Fedora 42
|
There are a few warnings for the Nelder-Mead algorithm
and
|
hi, I can totally reproduce with gcc 12/13 on ubuntu without any special flags, |
When building nlopt version 2.8.0 for openSUSE Tumbleweed, where the default C/C++ compiler is GCC 13, we find that running ctest gives the following "buffer overflow" errors:
We do not see these issues with the previous version of NLopt (2.7.1) using the same compiler, nor indeed when using older GCC (version 7) --- as we do for openSUSE Leap 15 --- to build NLopt 2.8.0.
Thanks.
The text was updated successfully, but these errors were encountered: