Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000813 [ALGLIB] Optimization minor always 2018-04-24 11:06 2018-04-27 16:06
Reporter rmanthorpe View Status public  
Assigned To SergeyB
Priority normal Resolution fixed  
Status resolved   Product Version 3.13.0
Summary 0000813: FIXED: minlmoptimize enters an infinite loop when fvec throws an exception on Windows x64
Description In recent versions of MSVC setjmp/longjmp used by ALGLIB internally interferes with throw/catch also used by ALGLIB to catch user exceptions. MSVC does not support longjmp() out of catch() clause (even though jump itself seems to be legitimate). Code starts looping forever.

New version of ALGLIB exception handling code better separates these two strategies, so no eternal loop takes place.

=== ORIGINAL MESSAGE ===================================================

The example below should exit with status 1 but never completes on Windows x64 using Visual Studio 2015 Update 3. It works as expected on Windows x86 and Linux.

test.cpp
---------------------------------------------------------------
#include "optimization.h"

void callback(const alglib::real_1d_array&, alglib::real_1d_array&, void*)
{
    throw 0;
}

int main()
{
    alglib::minlmstate state;
    alglib::real_1d_array x;
    x.setlength(1);
    alglib::minlmcreatev(1, x, 1e-5, state);
    try
    {
        alglib::minlmoptimize(state, &callback);
    }
    catch(...)
    {
        return 1;
    }
    return 0;
}
Additional Information
Programming language C++
Attached Files

- Relationships

-  Notes
(0000072)
SergeyB (administrator)
2018-04-26 15:51

OK, confirmed issue, started to debug
(0000073)
SergeyB (administrator)
2018-04-26 18:06

It turned out to be easy - in recent versions of MSVC setjmp/longjmp used by ALGLIB internally interferes with throw/catch also used by ALGLIB to catch user exceptions. Will be fixed in the upcoming 3.14.0.

Thank you for the report!

- Issue History
Date Modified Username Field Change
2018-04-24 11:06 rmanthorpe New Issue
2018-04-24 11:06 rmanthorpe Programming language => C++
2018-04-26 15:50 SergeyB Assigned To => SergeyB
2018-04-26 15:50 SergeyB Status new => feedback
2018-04-26 15:51 SergeyB Status feedback => assigned
2018-04-26 15:51 SergeyB Note Added: 0000072
2018-04-26 16:32 SergeyB Target Version => 3.14.0
2018-04-26 18:06 SergeyB Note Added: 0000073
2018-04-27 16:06 SergeyB Summary Minlmoptimize enters an infinite loop when fvec throws an exception on Windows x64 => FIXED: minlmoptimize enters an infinite loop when fvec throws an exception on Windows x64
2018-04-27 16:06 SergeyB Description Updated
2018-04-27 16:06 SergeyB Status assigned => resolved
2018-04-27 16:06 SergeyB Fixed in Version => 3.14.0
2018-04-27 16:06 SergeyB Resolution open => fixed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker