Skip to content
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

Bobyqa uninitialised variables in rare cases #133

Closed
ocommowi opened this issue Aug 23, 2017 · 6 comments
Closed

Bobyqa uninitialised variables in rare cases #133

ocommowi opened this issue Aug 23, 2017 · 6 comments

Comments

@ocommowi
Copy link
Contributor

Hello,

I know this is a follow-up to issue #36 but I do not know how to re-open it. I stumbled on the same problem (segmentation fault in altmov_ due to two variables being uninitialised) when using bobyqa together with the augmented lagrangian and a small tolerance as stopping criterion (10^-12).

I ended up modifying the code of bobyqa a very little which made it work:

  • line 764 : int ksav = 1;
  • line 768 : int ibdsav = 1;

This is only an ugly correction but I would be curious to know if someone has a better option to avoid this (I suspect all of this comes from the optimised parameters being a tiny little outside the bounds when entering bobyqa - from auglag - , which does not check for it)

Thanks

@jschueller
Copy link
Collaborator

jschueller commented Aug 23, 2017

hi, do you have an example that helps reproduce the issue ? which compiler are you using ?

@ocommowi
Copy link
Contributor Author

ocommowi commented Aug 23, 2017

Hi, well unfortunately the cost function being optimized is quite complex and very difficult to extract from the tool. I will try to find a simpler example but not sure I will be able to make the bug appear again. That being said when I looked at issue #36, it really sounded like the exact same crash problem.

@jschueller
Copy link
Collaborator

gcc gives even more "-Wmaybe-uninitialized" warnings

jschueller added a commit to jschueller/nlopt that referenced this issue Aug 23, 2017
Every variables that yields a -Wmaybe-uninitialized gcc warning is set to 0

Fixes stevengj#133
@jschueller
Copy link
Collaborator

jschueller commented Aug 23, 2017

could you check if #134 does solve your problem ?

I'm still interested in knowing your compiler.

@ocommowi
Copy link
Contributor Author

I would say yes, I am going to try, thanks ! However, in tour PR, I would be careful in bobyqa. Since it's a translation of a fortran code with indexes starting at 1, I think it is better to make the default values of the index variables (such as the ones I mentioned earlier) be 1 instead of 0. I might be wrong though, I get lost easily with these indexing problems

@jschueller
Copy link
Collaborator

I hope the code doesn't rely on it being uninitialized to something>1 then!
Please do test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants